Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

BatchSenderThread will wait for another heap of messages before send #48

Closed
dinarisio opened this issue Feb 18, 2015 · 4 comments
Closed

Comments

@dinarisio
Copy link
Contributor

BatchSenderThread would not send messages if new event popped before we WaitOne it and after encounting number of items to queue.

@lt72
Copy link
Contributor

lt72 commented Feb 18, 2015

I commented out the Sleep again because I cannot repro the issue and I want to see it failing

@dinarisio
Copy link
Contributor Author

I tried to find parameters to make it fail all the time, and in my machine it failes pretty often when i use small number(2-20) of test iterations. The thing I used in trying to challange code is to send message while BatchSenderThread is sending previous heap. And in some cases it will not able to reach for event on _doWork.
I did not know very much about an AutoResetEvent, but it turned out that there is a simple solution - to set timeout parameter at WaitOne, so regardless of message rate it would reach every x seconds. If x is not very small, it would not affect performance. What do you think about adding it?

@lt72
Copy link
Contributor

lt72 commented Feb 19, 2015

I found the race condition and set up a timeout to resolve it, for now...

@lt72 lt72 assigned lt72 and unassigned dinarisio Feb 19, 2015
@lt72
Copy link
Contributor

lt72 commented Feb 19, 2015

assigned this one to myself

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants