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

High CPU/memory usage after main unison process exits #27

Open
rowantran opened this issue Jun 27, 2024 · 1 comment
Open

High CPU/memory usage after main unison process exits #27

rowantran opened this issue Jun 27, 2024 · 1 comment

Comments

@rowantran
Copy link

Issue

If the main Unison process exits, e.g. because the SSH connection to the server was dropped, the fsmonitor process continues running and CPU/memory utilization increases dramatically.

When running with debug logs enabled, the following two logs are repeatedly printed after the Unison process exits:

event: Input("")
>> ERROR Unrecognized%20cmd%3A%20

I observed this issue on an M1 MacBook running macOS Sonoma, but I don't believe the issue is platform-dependent.

Reproduction

  1. Configure Unison with repeat=watch and set the destination to a remote server using SSH.
  2. Kill the SSH subprocess, which should cause Unison to exit with a "connection lost" error.
  3. Observe that the fsmonitor process continues running with increased CPU and memory usage.

Proposed Fix

I believe adding an exit statement to the send_error function here should resolve the issue by terminating the fsmonitor process after the first invalid input. We could also do something equivalent, like bubbling up an Error from handle_event and exiting the receiver loop.

This should be consistent with the reference fsmonitor implementation, which exits after printing an ERROR message (link)

I'm not particularly familiar with Rust or the fsmonitor protocol, so wanted to open this issue before opening a PR. But I'd be happy to work on the fix for this issue.

@JBYoshi
Copy link

JBYoshi commented Aug 24, 2024

Having the same issue here. Using version 0.3.4 installed via Homebrew, macOS 14.6.1. (Originally reported this as bcpierce00/unison#1053 but didn't realize this was a third-party version.)

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

No branches or pull requests

2 participants