You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by GitBox <gi...@apache.org> on 2022/05/23 02:32:26 UTC

[GitHub] [curator] paul8263 commented on pull request #406: [CURATOR-535] TestServer random port selection has a race condition

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: dev-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org