-
Notifications
You must be signed in to change notification settings - Fork 19
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
Queued messages should not get lost on exception during sending #12
Comments
Thanks for the note. This is a worthwhile idea, but it could get tricky quickly, because I think you'd want to count how many retries had been performed for a particular batch so that you don't retry an arbitrary number of times if the network goes down (and putting them back on the queue would then potentially overflow the queue, preventing new messages from being sent). Then you have to worry about how many retries, backoff, etc. I'd probably lean towards having your monitoring system monitor the error/exception logs in However, if you did want to do this, I'd suggest subclassing |
Also library is swallowing almost all exceptions, so even in synchronous mode you cannot retry |
@krzysbaranski I presume you're referring to the If you want to do retries or more complex behavior, you can subclass I'm going to close this issue per my earlier message. |
When I run
graphyte
in interval mode to let it send messages to Graphite in a background thread, all messages stored until the next scheduled send operation are stored in a queue. Once the next scheduled send is reached, messages will be popped from the queue and batched for sending. However, if the send operation fails (e.g. due to a temporary network outage), this batch of messages will be lost because they will not be put back into the queue for the next try.I think it would be useful to put messages back into the queue and try them again on the next scheduled interval, together with the ones which might have been added on top of them in the meantime.
If there are use cases where this behaviour is undesired, it could be made configurable in the constructor of the
Sender
class (retry_failed_messages=True
or similar).The text was updated successfully, but these errors were encountered: