Skip to content

Fix config file watch task leak#47246

Merged
probably-neb merged 1 commit intomainfrom
fix-config-file-watch-tasks-leak
Jan 20, 2026
Merged

Fix config file watch task leak#47246
probably-neb merged 1 commit intomainfrom
fix-config-file-watch-tasks-leak

Conversation

@probably-neb
Copy link
Collaborator

@probably-neb probably-neb commented Jan 20, 2026

Follow-Up-For: #47243

Previously, we would detach tasks spawned to watch config files. However, the task blocked on receiving a file event before checking if the receiver for the updates channel was dropped, causing the task to never exit. The fix here was to return the task explicitly, so that it can be dropped instead of calling .detach() on it. There is definitely a way to select! between the receiver being dropped and the next file system event, but I couldn't figure it out in a reasonable amount of time and decided it wasn't worth it.

Release Notes:

  • Fixed an issue where a few file descriptors would be leaked each time a project was closed

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 20, 2026
@probably-neb probably-neb changed the title fix config file watch tasks leak Fix config file watch task leak Jan 20, 2026
@probably-neb probably-neb merged commit d630677 into main Jan 20, 2026
31 checks passed
@probably-neb probably-neb deleted the fix-config-file-watch-tasks-leak branch January 20, 2026 20:58
zcg pushed a commit to zcg/zedpro that referenced this pull request Jan 29, 2026
Follow-Up-For:  zed-industries#47243

Previously, we would detach tasks spawned to watch config files.
However, the task blocked on receiving a file event before checking if
the receiver for the updates channel was dropped, causing the task to
never exit. The fix here was to return the task explicitly, so that it
can be dropped instead of calling `.detach()` on it. There is definitely
a way to `select!` between the receiver being dropped and the next file
system event, but I couldn't figure it out in a reasonable amount of
time and decided it wasn't worth it.

Release Notes:

- Fixed an issue where a few file descriptors would be leaked each time
a project was closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant