You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then we run into an issue where the collector actually only talks to one of the hosts, regardless of the hostname.
I think this is because of a thread safety issue in handler.py.
Even though the app is multithreaded, the same instance of metricsHandler is used for all requests (this is correct behavior).
However, on_get function references self, which means that the requests clobber each other's values.
Specifically, this is a problem for the code that translates hostnames to IPs and vice-versa.
Removing references to self in on_get fixes the issue.
Can you please let me know if I am off base here, or if this makes sense to you?
The text was updated successfully, but these errors were encountered:
Hi there,
If we issue a bunch of requests for different servers like so:
(note the & at the end of the curl command)
Then we run into an issue where the collector actually only talks to one of the hosts, regardless of the hostname.
I think this is because of a thread safety issue in handler.py.
Even though the app is multithreaded, the same instance of
metricsHandler
is used for all requests (this is correct behavior).However,
on_get
function referencesself
, which means that the requests clobber each other's values.Specifically, this is a problem for the code that translates hostnames to IPs and vice-versa.
Removing references to
self
in on_get fixes the issue.Can you please let me know if I am off base here, or if this makes sense to you?
The text was updated successfully, but these errors were encountered: