paul8263 commented on PR #406:
URL: https://github.com/apache/curator/pull/406#issuecomment-1134102562

   > It seems that with this patch it's still possible that a resolved port be 
in used by other process before it's used by the caller.
   
   Yes. currently this PR updates InstanceSpec so that the random port will 
only be allocated when it is actually used.
   But There are still some more steps before the port is actually used: wrap 
the configuration into QuorumPeerConfig and start the server. There could be a 
race condition in these steps.
   ```java    
   QuorumPeerConfig config = configBuilder.buildConfig(thisInstanceIndex);
   main.runFromConfig(config);
   ```
   I suggest we could introduce a file lock in order to alleviate the race 
condition among processes. But the implementation might be cumbersome.


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to