BELUGABEHR commented on a change in pull request #876: ZOOKEEPER-3020: Review
of SyncRequestProcessor
URL: https://github.com/apache/zookeeper/pull/876#discussion_r271282023
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/SyncRequestProcessor.java
##########
@@ -57,7 +58,7 @@
new LinkedBlockingQueue<Request>();
private final RequestProcessor nextProcessor;
- private Thread snapInProcess = null;
+ private final Semaphore snapThreadMutex = new Semaphore(1);
Review comment:
So, just FYI. I wanted to make this change because of two reasons:
1. It removes the special-case 'null' check (line 131) when the first
iteration occurs.
2. The last 'snapInProcess' variable is never cleared out so there is always
a dangling pointer to the last instance that ran... i.e., it never gets GC'ed
until the next time a snap process runs and kicks the previous reference out.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services