Skip to content
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

Deadlock in HTTP/2 #48220

Closed
ManickaP opened this issue Feb 12, 2021 · 5 comments · Fixed by #47769
Closed

Deadlock in HTTP/2 #48220

ManickaP opened this issue Feb 12, 2021 · 5 comments · Fixed by #47769
Assignees
Milestone

Comments

@ManickaP
Copy link
Member

When an HTTP/2 request is being completed and, at the same time, SETTING frame with SETTINGS_INITIAL_WINDOW_SIZE is received, a deadlock might occur.
Call stacks:

[Waiting on lock owned by Thread 64302] (Unknown Source:0)
System.Private.CoreLib.dll!System.Threading.Monitor.Enter(object obj, ref bool lockTaken) Line 47 (/home/manicka/Repositories/runtime/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs:47)
System.Net.Http.dll!System.Net.Http.Http2Connection.RemoveStream(System.Net.Http.Http2Connection.Http2Stream http2Stream) Line 1923 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:1923)
System.Net.Http.dll!System.Net.Http.Http2Connection.Http2Stream.Complete() Line 351 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs:351)
System.Net.Http.dll!System.Net.Http.Http2Connection.Http2Stream.SendRequestBodyAsync(System.Threading.CancellationToken cancellationToken) Line 247 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs:247)
...
[Waiting on lock owned by Thread 64317] (Unknown Source:0)
System.Private.CoreLib.dll!System.Threading.Monitor.Enter(object obj, ref bool lockTaken) Line 47 (/home/manicka/Repositories/runtime/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs:47)
System.Net.Http.dll!System.Net.Http.Http2Connection.Http2Stream.OnWindowUpdate(int amount) Line 429 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs:429)
System.Net.Http.dll!System.Net.Http.Http2Connection.ChangeInitialWindowSize(int newSize) Line 692 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:692)
System.Net.Http.dll!System.Net.Http.Http2Connection.ProcessSettingsFrame(System.Net.Http.Http2Connection.FrameHeader frameHeader, bool initialFrame) Line 632 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:632)
System.Net.Http.dll!System.Net.Http.Http2Connection.ProcessIncomingFramesAsync() Line 355 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:355)
...
@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Net.Http untriaged New issue has not been triaged by the area owner labels Feb 12, 2021
@ghost
Copy link

ghost commented Feb 12, 2021

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

When an HTTP/2 request is being completed and, at the same time, SETTING frame with SETTINGS_INITIAL_WINDOW_SIZE is received, a deadlock might occur.
Call stacks:

[Waiting on lock owned by Thread 64302] (Unknown Source:0)
System.Private.CoreLib.dll!System.Threading.Monitor.Enter(object obj, ref bool lockTaken) Line 47 (/home/manicka/Repositories/runtime/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs:47)
System.Net.Http.dll!System.Net.Http.Http2Connection.RemoveStream(System.Net.Http.Http2Connection.Http2Stream http2Stream) Line 1923 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:1923)
System.Net.Http.dll!System.Net.Http.Http2Connection.Http2Stream.Complete() Line 351 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs:351)
System.Net.Http.dll!System.Net.Http.Http2Connection.Http2Stream.SendRequestBodyAsync(System.Threading.CancellationToken cancellationToken) Line 247 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs:247)
...
[Waiting on lock owned by Thread 64317] (Unknown Source:0)
System.Private.CoreLib.dll!System.Threading.Monitor.Enter(object obj, ref bool lockTaken) Line 47 (/home/manicka/Repositories/runtime/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs:47)
System.Net.Http.dll!System.Net.Http.Http2Connection.Http2Stream.OnWindowUpdate(int amount) Line 429 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs:429)
System.Net.Http.dll!System.Net.Http.Http2Connection.ChangeInitialWindowSize(int newSize) Line 692 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:692)
System.Net.Http.dll!System.Net.Http.Http2Connection.ProcessSettingsFrame(System.Net.Http.Http2Connection.FrameHeader frameHeader, bool initialFrame) Line 632 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:632)
System.Net.Http.dll!System.Net.Http.Http2Connection.ProcessIncomingFramesAsync() Line 355 (/home/manicka/Repositories/runtime/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Connection.cs:355)
...
Author: ManickaP
Assignees: -
Labels:

area-System.Net.Http, untriaged

Milestone: -

@ManickaP ManickaP self-assigned this Feb 12, 2021
@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Feb 12, 2021
@ManickaP ManickaP added this to the 6.0.0 milestone Feb 12, 2021
@ManickaP
Copy link
Member Author

Fixed in #47769

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Feb 12, 2021
@ManickaP ManickaP removed the in-pr There is an active PR which will close this issue when it is merged label Feb 12, 2021
@karelz
Copy link
Member

karelz commented Feb 16, 2021

Reopening to track backport to 5.0

@karelz karelz reopened this Feb 16, 2021
@karelz karelz modified the milestones: 6.0.0, 5.0.x Feb 16, 2021
@ManickaP
Copy link
Member Author

@karelz can we close this since the 5.0 PR #47921 has beem merged?

@karelz
Copy link
Member

karelz commented Mar 16, 2021

Fixed in servicing branch for 5.0.5 (PR #47921) and in main branch for 6.0 (PR #47769).

@karelz karelz closed this as completed Mar 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants