You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains 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
The previous implementation is faulty:
Assume we have one active call.
When it ends, decrease_call_count will be invoked, gpr_atm_full_fetch_add decreases call_count from 1 to 0.
At this time, a new call arrives, increase_call_count is called, gpr_atm_full_fetch_add sees that call_count is 0. It then cancels the timer.
decrease_call_count then continues its operation, and uses grpc_timer_init to set up the timer.
After these operations, there is still an active call, but the max_idle timer is set. At the time this remaining call ends, it will cause the crash reported in #12257.
The new implementation does not cancel max_idle_timer (unless the channel is shutting down). Instead, it uses idle_state to record if max_idle_timer is still valid. If the timer callback is called when the max_idle_timer is valid (i.e. idle_state is MAX_IDLE_STATE_TIMER_SET), the channel will be closed due to idleness, otherwise the channel won't be changed.
Corrupt JSON data (indicates timeout or crash):
bm_fullstack_unary_ping_pong.BM_UnaryPingPong_InProcessCHTTP2_NoOpMutator_NoOpMutator__64_0.counters.new: 1
[microbenchmarks] No significant performance differences
@y-zeng if this PR is not yet merged on master, why not make this PR the primary one and get it upmerged alongside the rest of 1.9.x instead of having two PRs on master and 1.9.x?
@y-zeng Feel free to do whatever it is easier for you. I just thought upmerge is better because I imagined it would be easier for you, but whatever you feel is fine with me. Makes no difference.
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.
The previous implementation is faulty:
Assume we have one active call.
decrease_call_count
will be invoked,gpr_atm_full_fetch_add
decreasescall_count
from 1 to 0.increase_call_count
is called,gpr_atm_full_fetch_add
sees thatcall_count
is 0. It then cancels the timer.decrease_call_count
then continues its operation, and usesgrpc_timer_init
to set up the timer.After these operations, there is still an active call, but the
max_idle timer
is set. At the time this remaining call ends, it will cause the crash reported in #12257.The new implementation does not cancel
max_idle_timer
(unless the channel is shutting down). Instead, it usesidle_state
to record ifmax_idle_timer
is still valid. If the timer callback is called when themax_idle_timer
is valid (i.e.idle_state
isMAX_IDLE_STATE_TIMER_SET
), the channel will be closed due to idleness, otherwise the channel won't be changed.