-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix(s3fs): Add retries to Minio server start if ports are unavailable #15345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(s3fs): Add retries to Minio server start if ports are unavailable #15345
Conversation
✅ Deploy Preview for meta-velox canceled.
|
06f38fb to
0f4c7ba
Compare
| path.c_str()); | ||
| } catch (const std::exception& e) { | ||
| VELOX_FAIL("Failed to launch Minio server: {}", e.what()); | ||
| std::vector<int> ports = {9000, 65203}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initialization here seems unnecessary since the value will be overridden when getting the free ports.
| } catch (const std::exception& e) { | ||
| VELOX_FAIL("Failed to launch Minio server: {}", e.what()); | ||
| std::vector<int> ports = {9000, 65203}; | ||
| int kMaxRetryCount = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: constexpr auto kMaxRetryCount = 5;
| while (retries++ < kMaxRetryCount) { | ||
| try { | ||
| // Create a stream to capture process output. | ||
| boost::process::ipstream out_stream; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: out_stream -> outStream
JkSelf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@majetideepak Thanks for your fix. Leaving some comments.
There is a small chance that the PortUtil might return available ports, but the ports get taken away before use.
Retry if this is the case.
Add a delay to allow the MinIO server to start. Without this, there is a risk of tests being flaky due to the server
not being available.
Fixes: #15304