-
Notifications
You must be signed in to change notification settings - Fork 845
fix logic inconsistency in is_state_closed() #2096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
[approve ci] |
masaori335
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable.
|
This only happens when ATS itself is shutting down? |
|
Yes, only when making a graceful shutdown
…On Jun 8, 2017 1:38 PM, "Leif Hedstrom" ***@***.***> wrote:
This only happens when ATS itself is shutting down?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#2096 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADdQjGbQQTPCEezGGhVi4a4C0mftJVdqks5sCFu5gaJpZM4NznRo>
.
|
maskit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't had enough time to review so just leave a comment.
If you looked at other places where we send GOAWAY frame (send_goaway_frame()), we also sends HTTP2_SESSION_EVENT_FINI event , which sets fini_received true. I guess it's the right closing sequence, but I'm not 100% sure.
|
It sounds good, but I'm afraid that it start racing of scheduled @zizhong Who is calling |
From the backtrace, we can tell it happens when a stream gets |
|
Thanks. So it could be race of scheduled |
|
I'd rather schedule diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc
index 16ed21db7..9326565f5 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -1159,10 +1159,14 @@ Http2ConnectionState::release_stream(Http2Stream *stream)
}
}
- if ((fini_received || shutdown_state == IN_PROGRESS) && total_client_streams_count == 0) {
- // We were shutting down, go ahead and terminate the session
- ua_session->destroy();
- ua_session = nullptr;
+ if (total_client_streams_count == 0) {
+ if (fini_received) {
+ // We were shutting down, go ahead and terminate the session
+ ua_session->destroy();
+ ua_session = nullptr;
+ } else if (shutdown_state == IN_PROGRESS) {
+ this_ethread()->schedule_imm_local((Continuation *)this, HTTP2_SESSION_EVENT_FINI);
+ }
}
}
}Also, it's a nitpick, but I'm not a big fun of setting |
|
@maskit Since this is only on shutdown, we don't need this for 7.1.x do we ? |
|
@zwoop We need this too if we backport the series of the commits for graceful shutdown. |
|
@maskit Thanks for the suggestion! I'll update the code. |
813c9eb to
2abb2f8
Compare
|
@maskit @masaori335 updated. please review it again. Thanks! |
|
[approve ci] |
maskit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, but my approval is not effective on this because I suggested the change. Needs approval from someone else.
Fix a crash caused by H/2 graceful shutdown.
The issue is when ATS is shutting down and enters
Http2ConnectionState::cleanup_streams. It will checkis_state_closed(), which needs to returntrue. The logic needs to be consistent betweenis_state_closed()andHttp2ConnectionState::release_stream.@maskit @masaori335 Can you please take a look?