File tree Expand file tree Collapse file tree 3 files changed +3
-4
lines changed
binder/src/main/java/io/grpc/binder/internal
netty/src/main/java/io/grpc/netty
util/src/main/java/io/grpc/util Expand file tree Collapse file tree 3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -104,10 +104,9 @@ private synchronized void fail(Status status) {
104
104
}
105
105
106
106
private synchronized void success () {
107
- long currentTickerTimeNanos = ticker .read ();
108
107
if (!done ) {
109
108
done = true ;
110
- executor .execute (() -> callback .onSuccess (currentTickerTimeNanos - startTimeNanos ));
109
+ executor .execute (() -> callback .onSuccess (ticker . read () - startTimeNanos ));
111
110
}
112
111
}
113
112
}
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ public void updateWindow() throws Http2Exception {
200
200
setPinging (false );
201
201
202
202
long currentTickerTimeNanos = ticker .read ();
203
- long elapsedTime = ( currentTickerTimeNanos - lastPingTime );
203
+ long elapsedTime = Math . max ( 0L ,( currentTickerTimeNanos - lastPingTime ) );
204
204
if (elapsedTime == 0 ) {
205
205
elapsedTime = 1 ;
206
206
}
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ public Status acceptResolvedAddresses(ResolvedAddresses resolvedAddresses) {
149
149
initialDelayNanos = config .intervalNanos ;
150
150
} else {
151
151
long currentTickerTimeNanos = ticker .read ();
152
- long elapsedTimeNanos = currentTickerTimeNanos - detectionTimerStartNanos ;
152
+ long elapsedTimeNanos = Math . max ( 0L ,( currentTickerTimeNanos - detectionTimerStartNanos )) ;
153
153
// If a timer has started earlier we cancel it and use the difference between the start
154
154
// time and now as the interval.
155
155
initialDelayNanos = Math .max (0L ,
You can’t perform that action at this time.
0 commit comments