lost watch when client send two request without nonce
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at latestDiscoveryResponse, resourceNonce, and computeWatch in the handling shown in the issue; reproduce the restart case with a C++ client sending two requests without a nonce for one resource type. Trace why the second request is discarded, then verify that both requests' watched resources are retained with a regression test.
Written by the indexing model from the issue text.
Description
log
[2022-04-25 19:13:25.993] [DEBUG] [grpc-default-executor-0] [i.e.controlplane.server.OspDiscoveryServer] >>> [0] open stream from
[2022-04-25 19:13:26.009] [DEBUG] [grpc-default-executor-0] [i.e.controlplane.server.OspDiscoveryServer] >>> [0] request type.googleapis.com/envoy.api.v2.ClusterLoadAssignment[r1] with nonce from version 3
[2022-04-25 19:13:26.684] [DEBUG] [grpc-default-executor-0] [i.e.controlplane.server.OspDiscoveryServer] >>> [0] response type.googleapis.com/envoy.api.v2.ClusterLoadAssignment with nonce 0 version 0
[2022-04-25 19:13:26.696] [DEBUG] [grpc-default-executor-0] [i.e.controlplane.server.OspDiscoveryServer] >>> [0] request type.googleapis.com/envoy.api.v2.ClusterLoadAssignment[r1, r2, r3, r4] with nonce from version 3
When I restart xds server, C++ client will send two request without nonce for one resourceType, xds server response first request, then handle the second request.
In the code, xds server will discard the second request, watch resources in second request will lost.
LatestDiscoveryResponse latestDiscoveryResponse = latestResponse(requestTypeUrl);
String resourceNonce = latestDiscoveryResponse == null ? null : latestDiscoveryResponse.nonce();
if (isNullOrEmpty(resourceNonce) || resourceNonce.equals(nonce)) {
if (!request.hasErrorDetail() && latestDiscoveryResponse != null) {
setAckedResources(requestTypeUrl, latestDiscoveryResponse.resourceNames());
}
computeWatch(requestTypeUrl, () -> discoveryServer.configWatcher.createWatch(
ads(),
request,
ackedResources(requestTypeUrl),
r -> executor.execute(() -> send(r, requestTypeUrl)),
hasClusterChanged
));
}
- Dominant language
- Java
- Stars
- 312
- Forks
- 150
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from envoyproxy/java-control-plane
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
envoyproxy/java-control-plane#481 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
envoyproxy/java-control-plane#471 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
envoyproxy/java-control-plane#463 ·
-
help Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
envoyproxy/java-control-plane#432 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
envoyproxy/java-control-plane#411 ·
All issues in envoyproxy/java-control-plane
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100