-
Notifications
You must be signed in to change notification settings - Fork 367
Harden MCP Gateway startup health check against transient port-binding delays #26697
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
Changes from all commits
9a1376c
6194792
5fd98d1
70aa68e
93af3fc
f5cb3d5
2d880a4
d874474
0bb9333
7682cd2
ebf5c12
7b4184f
3588931
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -281,6 +281,21 @@ test_validation_functions_exist() { | |||||||||||||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||||||||||||||
| print_result "--network host flag validation missing" "FAIL" | ||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| # Check for health check retry/backoff logic | ||||||||||||||||||||||||||||||||||||||||||
| if grep -q "RETRY_COUNT -eq 1" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "RETRY_COUNT -eq 2" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "elif \[ \$RETRY_COUNT -eq 2 \]" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "else" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "RETRY_DELAY=\"0.25\"" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "RETRY_DELAY=\"0.5\"" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "RETRY_DELAY=\"1\"" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "attempt 3+ -> 1s" "$SCRIPT_PATH" && | ||||||||||||||||||||||||||||||||||||||||||
| grep -q "sleep \"\$RETRY_DELAY\"" "$SCRIPT_PATH"; then | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+286
to
+294
|
||||||||||||||||||||||||||||||||||||||||||
| if grep -q "RETRY_COUNT -eq 1" "$SCRIPT_PATH" && | |
| grep -q "RETRY_COUNT -eq 2" "$SCRIPT_PATH" && | |
| grep -q "elif \[ \$RETRY_COUNT -eq 2 \]" "$SCRIPT_PATH" && | |
| grep -q "else" "$SCRIPT_PATH" && | |
| grep -q "RETRY_DELAY=\"0.25\"" "$SCRIPT_PATH" && | |
| grep -q "RETRY_DELAY=\"0.5\"" "$SCRIPT_PATH" && | |
| grep -q "RETRY_DELAY=\"1\"" "$SCRIPT_PATH" && | |
| grep -q "attempt 3+ -> 1s" "$SCRIPT_PATH" && | |
| grep -q "sleep \"\$RETRY_DELAY\"" "$SCRIPT_PATH"; then | |
| if awk ' | |
| /if \[ \$RETRY_COUNT -eq 1 \]; then/ { saw_if=1 } | |
| saw_if && /RETRY_DELAY="0\.25"/ { saw_delay1=1 } | |
| saw_delay1 && /elif \[ \$RETRY_COUNT -eq 2 \]; then/ { saw_elif=1 } | |
| saw_elif && /RETRY_DELAY="0\.5"/ { saw_delay2=1 } | |
| saw_delay2 && /else/ { saw_else=1 } | |
| saw_else && /RETRY_DELAY="1"/ { saw_delay3=1 } | |
| saw_delay3 && /attempt 3\+ -> 1s/ { saw_comment=1 } | |
| saw_comment && /sleep "\$RETRY_DELAY"/ { saw_sleep=1 } | |
| END { exit saw_sleep ? 0 : 1 } | |
| ' "$SCRIPT_PATH"; then |
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.
@copilot use withRetry helper
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.
Updated to use the shared
withRetryhelper for MCP gateway health polling inactions/setup/js/start_mcp_gateway.cjs(commit7682cd2), with equivalent retry behavior preserved.