Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Closed
davidfowl opened this Issue Jun 19, 2013 · 6 comments

Comments

Projects
None yet
3 participants
Owner

davidfowl commented Jun 19, 2013

Use private reflection to call InternalRegisterWithoutEC

@ghost ghost assigned davidfowl Jun 19, 2013

@ghost ghost assigned muratg and Xiaohongt Jun 28, 2013

Contributor

Xiaohongt commented Jun 30, 2013

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.

Owner

davidfowl commented Jun 30, 2013

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?

Owner

davidfowl commented Jun 30, 2013

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).

Owner

davidfowl commented Jun 30, 2013

Is this a regression?

Contributor

Xiaohongt commented Jun 30, 2013

this is not regression.

Contributor

Xiaohongt commented Jul 2, 2013

verified no regression

@Xiaohongt Xiaohongt closed this Jul 2, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment