Skip to content
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

revise WriteAPI.Flush to attempt to send batches in the retry queue #291

Closed
wants to merge 2 commits into from

Commits on Dec 13, 2021

  1. WriteAPIImpl: simplify Flush() implementation

    The length of an unbuffered channel is always zero, and all checked
    channels are unbuffered, so all flush does is a transient
    synchronization with the writeProc and bufferProc goroutines.  Remove
    the unnecessary logic.
    
    Signed-off-by: Peter A. Bigot <[email protected]>
    pabigot committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    b9b12c8 View commit details
    Browse the repository at this point in the history
  2. DNM: WriteAPIImpl: extend Flush() to flush retry queue

    Flush() is documented to force all pending writes from the buffer to
    be sent.  It does force pending writes in the buffer to be submitted
    for send, but if there is a pending retry with an unexpired timeout it
    won't actually send anything.
    
    Make Flush() more useful by having it trigger a re-examination of the
    retry queue and initiating a retry immediately.
    
    Depending on whether the documented behavior was intentional, this
    operation might be better implemented as an additional WriteAPI method
    FlushAll().
    
    Signed-off-by: Peter A. Bigot <[email protected]>
    pabigot committed Dec 13, 2021
    Configuration menu
    Copy the full SHA
    4ca2194 View commit details
    Browse the repository at this point in the history