Open andyzinsser opened 9 years ago
This makes sense- perhaps we could have a setting on construction ("Either throw exceptions or just log errors")
We recently ran into this issue as well. Should there also be a configurable timeout, so we have control over how long we want to wait before gracefully moving on?
For timeouts, the answer is probably to use a custom consumer, so you can use your own settings (and maybe even your own library) at the HTTP client level- that means the fix for this should probably also have a demo of how that should be done.
In the mean time, that's probably the workaround for folks concerned about this issue - you can provide your own Consumer to your tracker, which can wrap the existing consumer, perhaps something like this
class LoggingFailuresConsumer(mixpanel.Consumer):
def send(self, *args, **kwargs):
try:
super(LoggingFailuresConsumer, self).send(*args, **kwargs)
except:
logAboutMixpanelErrors("Tracking failed", e)
Just ran into this issue yesterday because MixPanel was down again yesterday and brought our entire app down with it. Surprised to see this has been an open issue since 2015.
Our app stayed up, but we ended up chewing through a lot of Sentry event quota because of all these exceptions. Maybe raise the exception just once instead of for every single failure, or handle the problem in some other, more graceful manner?
For real, it is valuable to set a reasonable default timeout
I've also been unable to debug my Python app when not connected to the internet for the same reason:
mixpanel.MixpanelException
mixpanel.MixpanelException: HTTPSConnectionPool(host='api.mixpanel.com', port=443): Max retries exceeded with url: /engage (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x16bafd9a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
Can we please have an easy way to stop Mixpanel from preventing the app from starting when it can't connect to the internet?
Apologies if there's an easy solution to this that I'm missing.
This is only an issue when the API Ingestion is offline – which is hardly ever. When making any call using this library, the request hangs and then eventually times out.
It would be awesome if I could just call mixpanel.track() and not have to worry about whether or not the tracking event will cause our server to hang.
Example request
Stack trace