-
Notifications
You must be signed in to change notification settings - Fork 534
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
Docker setup: Wait for genesis file to exist before starting nodes #949
Docker setup: Wait for genesis file to exist before starting nodes #949
Conversation
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
I have read the CLA Document and I hereby sign the CLA |
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.
Thanks for the identifying this behavior and adding a remediation! This change looks good functionally.
I want to see your thoughts on implementing the depends_on
long syntax condition to handle this race scenario on the compose level for better init
feedback. We should be able to set the dependency to wait for the service_completed_successfully
condition to avoid premature node starts and uncaught init exceptions.
This approach does bring up an inevitable downstream condition where if the genesis.json
already exists in the defined volumes (make run-local; make stop-local; make run-local
to simply reproduce), then the init
service will exit with status code 1
and fail the condition. Adding a catch for this scenario in the polygon-edge.sh file should be sufficient for that case.
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.
LGTM
I didn't know about the Unfortunately I use I have made the change you suggested regarding the |
Thanks for the amendments! Made a quick https://github.com/mediremi-antithesis/polygon-edge/pull/1 to add in the changes as suggested. |
adding conditional dependency for compose to wait for successful node
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.
Tested and worked with the mentioned above changes regarding docker compose conditions. LGTM!
Codecov Report
@@ Coverage Diff @@
## develop #949 +/- ##
===========================================
+ Coverage 52.89% 52.91% +0.01%
===========================================
Files 129 129
Lines 17113 17113
===========================================
+ Hits 9052 9055 +3
+ Misses 7413 7411 -2
+ Partials 648 647 -1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
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.
LGTM 🏅
Description
The Docker image entrypoint
docker/local/polygon-edge.sh
had a race condition where if theinit
container took too long to generate thegenesis.json
genesis file, nodes would fail withError: open /genesis/genesis.json: no such file or directory
.This fix ensures that nodes wait for this file to exist (by polling for its existence in a loop) prior to starting up.
Changes include
Checklist
Testing
Manual tests
Manually tested by running
docker-compose up