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

Completable/Single Processors more robust top of stack removal #2116

Merged
merged 1 commit into from
Feb 27, 2022

Conversation

Scottmitch
Copy link
Member

Motivation:
Completable/Single Processors make a best effort to remove
nodes from the underlying data structure upon cancellation.
However if the node is the last added and there is concurrent
cancellation we may may fail to remove the node and give up
leading to increased memory consumption.

Modifications:

  • ClosableConcurrentStack should iterate the stack to remove
    the root node if the first removal attempt fails.

Result:
More robust cleanup of memory on removal.

Motivation:
Completable/Single Processors make a best effort to remove
nodes from the underlying data structure upon cancellation.
However if the node is the last added and there is concurrent
cancellation we may may fail to remove the node and give up
leading to increased memory consumption.

Modifications:
- `ClosableConcurrentStack` should iterate the stack to remove
  the root node if the first removal attempt fails.

Result:
More robust cleanup of memory on removal.
@Scottmitch Scottmitch merged commit a222317 into apple:main Feb 27, 2022
@Scottmitch Scottmitch deleted the stack_top_remove branch February 27, 2022 21:38
Copy link
Member

@idelpivnitskiy idelpivnitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
Consider cherry-picking this and #2114 into 0.41

Scottmitch added a commit that referenced this pull request Mar 1, 2022
Motivation:
Completable/Single Processors make a best effort to remove
nodes from the underlying data structure upon cancellation.
However if the node is the last added and there is concurrent
cancellation we may may fail to remove the node and give up
leading to increased memory consumption.

Modifications:
- `ClosableConcurrentStack` should iterate the stack to remove
  the root node if the first removal attempt fails.

Result:
More robust cleanup of memory on removal.
@Scottmitch
Copy link
Member Author

0.41 (805a73e)

@Scottmitch
Copy link
Member Author

@idelpivnitskiy - +1 for cherry-pick. done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants