Andrew, It sounds right to me that this is a bug. In any case, I'd like to suggest that you open a jira issue and propose your patch.


On Jan 21, 2009, at 6:52 AM, Andrew Carman wrote:

We were looking through the ZK server code and came across a possible bug that occurs when shutting down the SyncRequestProcessor (it may also apply
to other RequestProcessors, we didn't investigate).

When shutdown() is called in server/, it adds the requestOfDeath to the processor's queue and when the run loop reaches the requestOfDeath in the queue it immediately stops the processor. However, if the request processor is being bombarded by new requests, it only calls flush when there are 1000 requests backed up to flush. If the requestOfDeath is received when the toFlush buffer is partially full, the processor stops immediately without flushing those remaining requests. These requests are lost. This causes our test for Zab to break, so we thought it may also be a
problem for ZK as well. Is it?

If so, our proposed fix is:
(revision 736200)
(working copy)
@@ -77,6 +77,7 @@
                if (si == requestOfDeath) {
+                    flush(toFlush);
                if (si != null) {

Harvey Mudd Clinic Team

Reply via email to