Skip to content

Dont block executor when syncing files or mutexes#32

Merged
ftilde merged 2 commits intomainfrom
dont-block-executor
Feb 4, 2026
Merged

Dont block executor when syncing files or mutexes#32
ftilde merged 2 commits intomainfrom
dont-block-executor

Conversation

@ftilde
Copy link
Contributor

@ftilde ftilde commented Feb 4, 2026

I've been noticing for some time now that syncs sometimes take longer than expected (which is really confusing and annoying when you then accidentally execute old code on a remote machine...).

Investigation showed that the sync process itself is started late. The reason for that is that other tasks running subprocesses were doing so in a blocking fashion and thus preventing the executor from executing other tasks in the mean time. In this concrete example the mutex task was hindering a folder sync task from being executed. When syncing to two folders simultaneously the same could happen, though. Notably, this does not result in parallel sync to the same folder (which would be undesirable) because the folder sync task itself is waiting for the sync process to finish.

Fix: Use asyncio.subprocess instead of subprocess.check_output (or similar) and mark the functions async.

@ftilde ftilde requested a review from falkoschindler February 4, 2026 10:21
Copy link
Contributor

@falkoschindler falkoschindler left a comment

Choose a reason for hiding this comment

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

Code looks good to me.
Assuming you successfully tested it, the PR is ready to merge. 👍🏻

@ftilde ftilde merged commit 05970e2 into main Feb 4, 2026
2 checks passed
@ftilde ftilde deleted the dont-block-executor branch February 4, 2026 12:04
@falkoschindler falkoschindler added this to the 0.4.0 milestone Feb 4, 2026
@falkoschindler falkoschindler added the bug Something isn't working label Feb 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants