Skip to content

multiple engines, multiple containers, same pid #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zzzeek opened this issue Nov 18, 2019 · 2 comments
Closed

multiple engines, multiple containers, same pid #9

zzzeek opened this issue Nov 18, 2019 · 2 comments

Comments

@zzzeek
Copy link
Member

zzzeek commented Nov 18, 2019

we see this in nova, multiple sets of values:

[2019-11-18 23:46:52] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120812, interval=2, values=[328630, 0, 457, 456])
[2019-11-18 23:46:53] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120813, interval=2, values=[164346, 0, 457, 455])
[2019-11-18 23:46:53] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120813, interval=2, values=[164346, 0, 457, 455])
[2019-11-18 23:46:54] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120813, interval=2, values=[283516, 0, 907, 905])
[2019-11-18 23:46:54] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120814, interval=2, values=[328630, 0, 457, 456])
[2019-11-18 23:46:55] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120815, interval=2, values=[164346, 0, 457, 455])
[2019-11-18 23:46:55] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120815, interval=2, values=[164346, 0, 457, 455])
[2019-11-18 23:46:56] [sqlalchemy_collectd.server.plugin] receive[UDP:localhost:25827] -> sqlalchemy_collectd.Values(type='sqlalchemy_totals', type_instance='6', plugin='sqlalchemy', plugin_instance='nova', host='overcloud-controller-0', time=1574120815, interval=2, values=[283516, 0, 907, 905])

two different sets of totals and same pid of 6. now i would think this is because, OK nova has the main DB and the API DB, but looking in plugin.py, CollectionTarget is a process-wide singleton, multiple engines go into it. i see there are two Senders set up, which is wrong and we can see messages being sent twice above, but...they send on the same collection target which should mean only one value. the above are running in containers so "6" is local to a container, need to see if that is a factor here.

@zzzeek
Copy link
Member Author

zzzeek commented Nov 18, 2019

so if you look in the podman containers for all 8 nova services, they are all on pid 6 :) which means we have an issue here that these are different processes but they see the same pid due to containers :)

@zzzeek
Copy link
Member Author

zzzeek commented Nov 18, 2019

and im going to take a guess that running in a docker container, you have a pid, the job of "hey what's my pid on the host machine?" is exactly where "sandbox" would say, GET LOST YOU'RE IN A SANDBOX WE'RE TRYING TO PRETEND THIS IS SECURE! . sooooo.....pid + hostname is not enough! we need something else for containers with net=host. bleah.

@zzzeek zzzeek changed the title multiple engines, same process multiple engines, multiple containers, same pid Nov 19, 2019
sqlalchemy-bot pushed a commit that referenced this issue Nov 19, 2019
This is so that multiple processes on the same host that
happen to have the same pid due to namespacing / containers
may still be disambiguated.  it also allows a recycled
pid to appear as a new process.

Fixes: #9
Change-Id: I605263c848c4a7899e47cab81e90542be993d2d2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant