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

Avoid async operations while protect is running #1619

Closed
wants to merge 3 commits into from

Conversation

kpdecker
Copy link
Contributor

@kpdecker kpdecker commented May 6, 2014

Sockets were being associated with random unrelated requests that were executing when the incoming socket connection is made due to the domain entry and exit spanning multiple event loop cycles.

Additionally this pattern was prone for other concurrent execution issues where the domain stack is left in an unexpected state due to races between two concurrent requests, i.e.

request1.enter();
request2.enter();
request1.exit();

Causes the domains stack to be cleared of both request1 and request2 even though request2 is still executing.

Sockets were being associated with random unrelated requests that were executing when the incoming socket connection is made due to the domain entry and exit spanning multiple event loop cycles.

Additionally this pattern was prone for other concurrent execution issues where the domain stack is left in an unexpected state due to races between two concurrent requests, i.e.

```
request1.enter();
request2.enter();
request1.exit();
```

Causes the domains stack to be cleared of both request1 and request2 even though request2 is still executing.
@kpdecker
Copy link
Contributor Author

kpdecker commented May 6, 2014

@hueniverse I took a look at a leak pattern on a heap dump for a server that was running for a few days. The socket -> domain reference links together different requests into a chain that makes it extremely difficult to GC the request objects as each new request extends the reference lifetime of the existing request.

image

On one heapdump from a number of days there were instances that likely had 30+ requests retained in this manner.

@hueniverse hueniverse added the bug label May 12, 2014
@hueniverse hueniverse added this to the 4.1.1 milestone May 12, 2014
@hueniverse hueniverse self-assigned this May 12, 2014
@hueniverse hueniverse closed this May 12, 2014
@hueniverse hueniverse deleted the protect-domains branch May 14, 2014 06:25
@lock lock bot locked as resolved and limited conversation to collaborators Jan 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bug or defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants