-
Notifications
You must be signed in to change notification settings - Fork 62
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
Pending flushes don't flush during periods of inactivity #45
Comments
SGTM. My only two cents: this seems like the kind of thing where thread safety could be tricky. Proper synchronization is necessary when accessing batches in flight. (end of nagging) |
Seems like a fine idea, but wouldn't a more direct solution to your |
Hey Todd. |
No, I like the monitor thread idea, I just was trying to be helpful in |
One thing that I would like to see is if the operation of the monitor was optional. @drevell don't you think that if the batch in flight is only accessed through flush() that already wraps up the synchronization issues? |
Sure, a monitor thread sounds fine, as long as there's no race between checking if a batch needs to be flushed and deciding to flush it; do we need a conditional flush that holds a lock? |
During the flush cycle batches are handed over to a the flush thread pool.
Batches are flushed when the size threshold is breached, or if the TTL expires. However, the TTL is only checked when a new Op is added.
During periods of inactivity we notice inaccurate counts which is undesirable.
It would be good if the TTL flush occurred even when no new Ops are incoming.
I would propose adding a monitor thread that checked every minute or so if there were any flushes pending. Thoughts?
[we need this for graceful shutdown reasons - currently we loose batches in flight]
The text was updated successfully, but these errors were encountered: