run: Omit '--watch' from startup#321
Merged
Merged
Conversation
Passing the '--watch' option causes the HTTP listener restarts under
parallel POST requests, making the listener unavailable for brief
periods, during which the incoming connections get reset (TCP RST). When
Envoy upstream connections get reset like this, HTTP status 503 is
reported to the HTTP client at the source pod, as seen in Cilium CI when
sending parallel POST requests via Envoy:
❌ command "curl --silent --fail --show-error --connect-timeout 2 --max-time 10 -6 --parallel --parallel-immediate -w %{local_ip}:%{local_port} -> %{remote_ip}:%{remote_port} = %{response_code}\n --output /dev/null -X POST http://[fd00:10:244:1::c17f]:8080/private http://[fd00:10:244:1::c17f]:8080/private http://[fd00:10:244:1::c17f]:8080/private" failed: command failed (pod=cilium-test-2/client2-78bbbfb455-b47fk, container=client2): command terminated with exit code 22
ℹ️ curl stdout:
fd00:10:244:1::cdfa:38402 -> fd00:10:244:1::c17f:8080 = 503
fd00:10:244:1::cdfa:38404 -> fd00:10:244:1::c17f:8080 = 503
fd00:10:244:1::cdfa:38420 -> fd00:10:244:1::c17f:8080 = 503
ℹ️ curl stderr:
curl: (22) The requested URL returned error: 503
curl: (22) The requested URL returned error: 503
curl: (22) The requested URL returned error: 503
The '--watch' option is only needed when the file can be modified by
another process, which is not the case when using cilium/json-mock image
for Cilium testing, so it should be safe to omit the '--watch'
option. When running without the '--watch' option, the HTTP listener does
not get restarted and parallel POST requests succeed as expected.
Reproduction:
$ docker run --rm -d --name json-mock-watch-repro \
-p 18080:8080 -e PORT=8080 quay.io/cilium/json-mock:v1.4.0
$ for i in $(seq 1 100); do \
curl --silent --fail --show-error \
--connect-timeout 1 --max-time 3 \
--parallel --parallel-immediate \
-X POST \
http://127.0.0.1:18080/public \
http://127.0.0.1:18080/public \
http://127.0.0.1:18080/public \
>/dev/null || echo "failed iteration $i"; done
This quickly reproduces these failures, and the docker container logs
show repeated messages like:
/default.json has changed, reloading...
Loading /default.json
Loading /middleware.js
Done
When running without the '--watch' option the curl loop produces no
failures.
Signed-off-by: Jarno Rajahalme <jarno@isovalent.com>
Member
Author
|
Example Cilium CI workflow run with this flake: https://github.com/cilium/cilium/actions/runs/29041892696/job/86200869896 |
tklauser
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passing the
--watchoption causes the HTTP listener restarts under parallel POST requests, making the listener unavailable for brief periods, during which the incoming connections get reset (TCP RST). When Envoy upstream connections get reset like this, HTTP status 503 is reported to the HTTP client at the source pod, as seen in Cilium CI when sending parallel POST requests via Envoy:The
--watchoption is only needed when the file can be modified by another process, which is not the case when using cilium/json-mock image for Cilium testing, so it should be safe to omit the--watchoption. When running without the--watchoption, the HTTP listener does not get restarted and parallel POST requests succeed as expected.Reproduction:
This quickly reproduces these failures, and the docker container logs show repeated messages like:
When running without the
--watchoption the curl loop produces no failures.