Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't capture the execution context when registering cancellation token callbacks. #2167

Closed
davidfowl opened this Issue · 6 comments

3 participants

@davidfowl
Owner

Use private reflection to call InternalRegisterWithoutEC

@davidfowl davidfowl was assigned
@muratg muratg was assigned
@Xiaohongt Xiaohongt was assigned
@Xiaohongt
Collaborator

1). cancellation token callback in ForeverTransport.cs doesn't get called for forereverFrame and serverSentEvents when cancel, however it works for websockets.

2). cancellation token callback in TransportDisconnectBase.cs doesn't get called when host stop, when I change to use Register method instead of SafeRegister here the callback get called.

@davidfowl
Owner

Can you be more clear about the exact repro steps? You're saying that they never fire anymore and we leak memory like crazy now?

@davidfowl
Owner

I'm trying it out with server sent events and cancel is firing. Here's what I did:

Opened the raw sample to the following url
http://localhost:40476/Raw/?transport=serverSentEvents

Open the task manager in chrome:
image

Killed the tab and waited for End() to be called on TransportDisconnectBase (this calls Cancel() and triggers the callback).

@davidfowl
Owner

Is this a regression?

@Xiaohongt
Collaborator

this is not regression.

@Xiaohongt
Collaborator

verified no regression

@Xiaohongt Xiaohongt closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.