GithubHelp home page GithubHelp logo

Comments (3)

benhoyt avatar benhoyt commented on August 20, 2024 2

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 send_socket and alerting you on failure so you can fix the underlying issue.

However, if you did want to do this, I'd suggest subclassing Sender and overriding send_socket in your own code. You could either just retry a couple of times in a loop if there's an exception, or push the message back onto the queue to be picked up in the next interval.

from graphyte.

krzysbaranski avatar krzysbaranski commented on August 20, 2024

Also library is swallowing almost all exceptions, so even in synchronous mode you cannot retry

from graphyte.

benhoyt avatar benhoyt commented on August 20, 2024

@krzysbaranski I presume you're referring to the except Exception in send_socket? True, though that's definitely by design. The thinking is the caller shouldn't have to worry about errors; so graphyte logs them (assuming you're doing something with your logs).

If you want to do retries or more complex behavior, you can subclass Sender and override send_socket (which is used in both sync or async mode), adding your own exception handling, retries, etc. In your override, you'd call send_message -- which doesn't have a catch-all except clause -- to do the low-level sending operation.

I'm going to close this issue per my earlier message.

from graphyte.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.