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

Does not wait for server to start and fails #10

Open
MistrKernnunos opened this issue Feb 20, 2022 · 4 comments
Open

Does not wait for server to start and fails #10

MistrKernnunos opened this issue Feb 20, 2022 · 4 comments

Comments

@MistrKernnunos
Copy link

When starting from aw-qt the wayland-window-watcher calls the aw-server before it starts.

@johan-bjareholt
Copy link
Member

Not sure if this should be reported for aw-qt or for aw-watcher-window-wayland.

@ErikBjare
Copy link
Member

ErikBjare commented Mar 3, 2022

aw-qt takes some precautions to start the server before watchers (and sleeps ~1s in between to give the server time to start).

IMO, an unavailable server should not lead to a crash/error, it should just try again later (or even better, queue up the events).

@johan-bjareholt
Copy link
Member

@ErikBjare 1s sounds racy, why not poll if the aw-server port is up or something?

I agree that it's good if watchers wait and queue up events, but at the same time the watcher should eventually tell the user that it's not connected, and the usual way to do that is to shutdown/crash.

@meliache
Copy link
Contributor

meliache commented Jul 12, 2023

I think I saw the same when I tried running the watcher with

aw-qt --autostart-modules aw-server,aw-watcher-window-wayland

Then I get the error dialogue

Module aw-watcher-window-wayland quit unexpectedly
Details: No log file found

It gives me the option to restart and when I do everything works. Is there a workaround to this until this is fixed? Can I start the server and wayland watcher manually and then connect aw-qt to them afterwards? Ideally in a scriptable way that doesn't requite user input, so that I can put it into my sway config.

UPDATE:

I fixed that by hardcoding a 3s sleep in the main.rs of this wayland watcher. Have almost no rust experience so asked chatgpt how to do that (thread::sleep(Duration::from_secs(3))). But with some knowledge of rust and the codebase it should be trivial to add retries of with a timeout to the relevant parts of the code. Though I agree that if would be better to check first that this is not an issue with the activity-watcher codebase and that the API is correctly used, before doing such workaround.

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

4 participants