Skip to content

Comments

Clean up cancelled requests after processing them#3971

Open
vinistock wants to merge 1 commit intomainfrom
02-20-clean_up_cancelled_requests_after_processing_them
Open

Clean up cancelled requests after processing them#3971
vinistock wants to merge 1 commit intomainfrom
02-20-clean_up_cancelled_requests_after_processing_them

Conversation

@vinistock
Copy link
Member

@vinistock vinistock commented Feb 20, 2026

Motivation

We were growing the cancelled requests list indefinitely when the notification came in during process. We only cleaned up if the editor managed to cancel the request before we got to it.

Implementation

We can fix the unbound memory growth by always ensuring that we delete from the list after processing.

Automated Tests

Added a test to ensure that the list is always empty after the request got processed.

Copy link
Member Author


How to use the Graphite Merge Queue

Add the label graphite-merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock self-assigned this Feb 20, 2026
@vinistock vinistock added bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes labels Feb 20, 2026 — with Graphite App
@vinistock vinistock marked this pull request as ready for review February 20, 2026 22:04
@vinistock vinistock requested a review from a team as a code owner February 20, 2026 22:04

process_message(message)
# Ensure we remove the request if it got cancelled while it was being processed
@cancelled_requests.delete(id)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is now outside the @global_state.synchronize block. Does it need to be wrapped again?

Suggested change
@cancelled_requests.delete(id)
@global_state.synchronize { @cancelled_requests.delete(id) }

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

Labels

bugfix This PR will fix an existing bug server This pull request should be included in the server gem's release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants