zynthian / zynthian-issue-tracking

Centralized Issue Tracking for Zynthian Project
https://github.com/orgs/zynthian/projects/1
11 stars 3 forks source link

Restarting UI can lead to ongoing x-runs #718

Open riban-bw opened 2 years ago

riban-bw commented 2 years ago

Describe the bug Each time the UI is restarted there is a risk that xruns will start to occur. It seems that resources may not be released properly when the UI is restarted.

To Reproduce Steps to reproduce the behaviour:

  1. Add engines (may be most prevalent with jalv engines)
  2. From admin menyu, restart UI

Expected behaviour UI restarts with at least same performance as before restart.

Actual behaviour UI restarts but xruns may begin to occur continually or periodically.

Setup:

Additional context This may relate to the issue encountered during development that restarting Zynthian within 10s of stopping it can cause resource leakage. Some engines or processes may not be stopping properly.

riban-bw commented 1 year ago

It looks like some modules are not fully closing before systemd is restarting Zynthian. systemctl stop zynthian can return before journalctl -fu zynthian has stopped showing messages related to zynthian.

riban-bw commented 4 months ago

I believe resolving #1006 can help here. If we are able to restart jack2 service then any stale client connections should be removed. I don't know if those clients would then gracefully die or would continue to exist in memory as a resource leak but it is a pragmatic approach. Of course, identifying clients that are not disconnecting properly and fixing that may be a more correct approach but it may involve delving into lots of upstream code.