*: support "continue" to label within for-loop #12
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.
Use case: I've been trying to integrate https://github.com/coreos/etcd/tree/master/tools/local-tester with our functional testing, by setting up a bridge between listen and advertise ports, to simulate network faults (e.g. drop all incoming packets to follower's advertise peer port to simulate an isolated follower).
However, the bridge layer cannot simulate outbound packet drops:
It can only simulate append/snapshot message drops but not leader heartbeat drops (rafthttp creates an HTTP client to the leader's advertise peer port to poll leader heartbeats).
To summarize, we need
continue
support, to simulate leader heartbeat dropping (trying to extend it to test etcd-io/etcd#9333 and etcd-io/etcd#9563):This PR adds a support for
"continue" + label
, as below:continue
failpoint must have matchinggofail
comments: one to definecontinue
label, the other to define non-blockingEval
method call (sincedefer
would blockDELETE
calls).gofail enable ./rafthttp
would output:I tried it, and it seems to work well for our use case (
gofail disable ./rafthttp
works as well).Any thoughts or better way? @heyitsanthony
Thanks!