paul8263 commented on PR #406: URL: https://github.com/apache/curator/pull/406#issuecomment-1141583133
Hi @tisonkun @eolivelli and @Randgalt , Thank you for your reply. This problem is unusual. I got this problem when running unit tests in other project which relies on Zookeeper. The unit tests are running parallelly so that TestServer creating process might get a race condition when allocating unused ports. Currently my solution is the steps below: 1. Get a random unused port. 2. Implementing a file lock. 3. Allocating the port to TestServer. 4. Check if TestServer starts properly. If it starts successfully, release the file lock. I would like to move those steps inside TestServer creation and start process. However I worry that introducing a file lock might not be the best solution as it only solves an unusual problem at the cost of performance degradation. Have you got any better ideas? I think using the file lock should be considered as the last resort. Correct me if I am wrong. -- 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]
