mirror of
https://github.com/debauchee/barrier.git
synced 2026-05-15 14:16:02 -06:00
[GH-ISSUE #652] GUI does not report "running" if log level is not verbose enough (NOTE or 'higher') #519
Labels
No labels
HiDPI
bounty
bsd/freebsd
bsd/openbsd
bug
bug
build-infra
cantfix
critical
doc
duplicate
enhancement
fix-available
from git
from release
good first issue
help wanted
installer/package
invalid
linux
macOS
meta
needs testing
pull-request
query
question
regression
regression
v2.4.0
windows
wontfix
work-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/barrier#519
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @plessbd on GitHub (May 4, 2020).
Original GitHub issue: https://github.com/debauchee/barrier/issues/652
Operating Systems
Server: macOS Catalina 10.15.4
Client: macOS Catalina 10.15.4
Barrier Version
2.3.3-snapshot-b6a1b574 (with applied #648)
Steps to reproduce bug
If the log level is ERROR or WARNING the GUI does not correctly get 'RUNNING' state
https://github.com/debauchee/barrier/blob/master/src/gui/src/MainWindow.cpp#L379-L399
Server
Good:
Bad:
Client:
Good:
Bad:
@simons-public commented on GitHub (May 4, 2020):
@plessbd Can you try this updated build? Earlier in #648 I had forgotten to manually specify
barriercandbarriersin themacdeployqtarguments with-executable=. Since they're not listed in CFBundleExecutable in the plist they weren't getting picked up.It might not be related, but it could be causing issues if the gui and command line binaries are linked to different libraries. I didn't experience the same issue, but I'm still running on Mojave since I need 32bit.
@plessbd commented on GitHub (May 4, 2020):
That did not seem to change anything except I had to reallow the application in accessibility.
Feel free to let me know if there is something else I can try. I am comfortable editing source and all.
@simons-public commented on GitHub (May 4, 2020):
If you know the last commit that didn't have that issue you could do a
git bisectand figure out which change broke it. You might have togit cherry-pickthe commits from #648 to get it to build though, I don't know how long thebuild_installer.shscript has been not working for.I'll look through the repo and see how the barrier GUI process communicates with the server and see if there's any troubleshooting info that can be gleaned from that. I'm curious as to how its communicating status.
Also if you could post a
dtrussoutput for the main barrier process to a gist that could help narrow it down. Runningsudo dtruss -n barriershould pick it up. That'll show all the system calls that the main process is making.@simons-public commented on GitHub (May 5, 2020):
I think I see the issue in your log:
[2020-05-04T11:26:50] WARNING: cannot listen for clients: cannot bind address: Address already in useIt looks like there might another process tying up the socket. It's keeping the
barriersprocess from outputtingserver status: activeto stdout, which is how the barrier GUI checks that the server is running.If you kill any old
barrier/barriers/barriercprocesses or reboot it might fix the problem. Or it might be a new daemon in Catalina that uses the same ports as barrier's IPC (24801) since there's another issue with the same symptoms. I figure it's just the IPC port since client/server connectivity happens on 24800 and you said the service is working otherwise.@plessbd commented on GitHub (May 5, 2020):
found the issue
https://github.com/debauchee/barrier/blob/master/src/gui/src/MainWindow.cpp#L379-L399
Which seems you added to the other issue already.
So this only happens when log level is not error or warning, otherwise it doesnt say that it has started.
@simons-public commented on GitHub (May 5, 2020):
Are you still getting the warning about binding the address from your original edit on the issue though? If it’s another ‘barriers’ process running in the background #654 is just going to mask the real issue. The GUI still won’t be connected to the ‘barriers’ process it is running, so the stop command won’t actually stop the process that is handling inbound port 24800 connections. What should change is the server should exit with a failure and an error message if it can’t bind to the port that way you get an indication of the underlying issue.
@plessbd commented on GitHub (May 5, 2020):
I believe that was a different issue as I somehow got into a state where I did have multiple barrier-servers running, not sure how that happened.
But testing on a rebooted system did not show those errors anymore.
@simons-public commented on GitHub (May 5, 2020):
The multiple servers issue can still happen with #654 in place though since the server can still show ‘starting cocoa loop’ even if it can’t bind to the port (as shown in your original log post before the edit). It makes connectivity issues harder to troubleshoot for users.
Until the GUI uses barrier IPC to communicate status it’s better to have the ‘barriers’ process exit on failing to bind. I can make a pull request that does that later today.I just checked I can very consistently reproduce the described behavior by starting another
barriersinstance from the command line and clicking Start on the GUI. Then after stopping and killing any extrabarriersinstances, clicking on the Start button shows "Barrier is running."Barrier appears to be working because there is another instance of the server running, but the GUI is not talking to that other instance, so it never triggers the "Barrier is running." message despite not throwing any errors. Clicking Stop in this instance also won't stop the other instance from running.
I think elevating the
cannot listen for clients:log to from WARNING to ERROR is actually the best option here. That lets users know that thebarriersprocess being controlled by the GUI is not going to work if it can't bind the socket, and that the port is already in use by another process that needs to be stopped.@simons-public commented on GitHub (May 12, 2020):
@plessbd Sorry I totally missed the point you were getting at that ERROR or WARNING levels don't print INFO messages.
I think checking for
starting cocoa loopin #654 doesn't give the right status since it still shows that in the logs even if it can't bind to the port, but I changed the log level for the messages that the GUI checks for in #664 if you wouldn't mind trying it.@plessbd commented on GitHub (May 12, 2020):
@simons-public it works, but has made me realize the loglevel is "ignored" for the first 3 messages
https://github.com/debauchee/barrier/blob/master/src/gui/src/MainWindow.cpp#L539-L548
and by ignored, I mean output prefixed with INFO
I guess we could say "There are three hard things in Computer Science: cache invalidation, naming things, what level to log message, and off-by-one errors"
@simons-public commented on GitHub (May 12, 2020):
@plessbd The first 3 INFOs are printed, but you are still right that the INFO level messages do drop off before the "started server (%s), waiting for clients" gets parsed for updating the client status.
I like your addition to that quote, I'm totally saving that for later.