-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Open
Labels
area/cluster-flowIssues or PRs related to cluster flow controlIssues or PRs related to cluster flow control
Milestone
Description
// https://github.com/alibaba/Sentinel/blob/bef6574734bc75953202079dc0a44aa5dff78157/sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/NettyTransportClient.java#L222
channel.writeAndFlush(request);
ChannelPromise promise = channel.newPromise();
TokenClientPromiseHolder.putPromise(xid, promise); // 1、should before writeAndFlush to avoid concurrency problem
if (!promise.await(ClusterClientConfigManager.getRequestTimeout())) {
throw new SentinelClusterException(ClusterErrorMessages.REQUEST_TIME_OUT); // 3、timeout exception
}
// https://github.com/alibaba/Sentinel/blob/bef6574734bc75953202079dc0a44aa5dff78157/sentinel-cluster/sentinel-cluster-client-default/src/main/java/com/alibaba/csp/sentinel/cluster/client/handler/TokenClientPromiseHolder.java#L47
if (!PROMISE_MAP.containsKey(xid)) {
return false; // 2、we can't complete the promise
}
Metadata
Metadata
Assignees
Labels
area/cluster-flowIssues or PRs related to cluster flow controlIssues or PRs related to cluster flow control