-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
Keep alive when i3bar hidden #266
Conversation
@cornerman could you just confirm that this is working for you. It should all be good but worth double checking. |
By default i3bar sends a -SIGSTOP to a process sending it data. This causes some modules interacting with i3 ipc to be suspended, which lead to locking issues inside i3. This patch switches to using SIGUSR2 as the suspend signal. The async modules eg window_title_async were affected. see ultrabug#253
Note: this patch just fixes the immediate issue of i3 crashing. Further work is needed.
|
It works for me! |
Wait, this does not work as expected. Sorry, but I overlooked that i3status actually crashes, so we cannot just continue when we receive USR2 from i3status. There is something else going on... |
By default, signals are dispatched to all subprocesses and i3status exits when it receives a SIGUSR2. So, in order to avoid sending this signal to i3status, we could do this when we open the subprocess:
We could probably also translate it to SIGSTOP there. |
Hmm this is frustrating. Yesterday I could reproduce this bug today I can't. @cornerman is there a minimal
feels like it should be enough but I can't trigger stuff |
Seems that it happens with any config for me. What happens if you do:
For me, all i3status processes exit and py3status busy waits as we now ignore that i3status exited. |
This will also fix #179 |
OK, I can trigger it again via Should have an updated patch soon. Thanks |
@cornerman could you test the latest version which includes your fix and also should stop i3status (which should wake up too) |
Nice, it works! |
Nice bit of teamwork there 👍 @ultrabug this patch should be ready for consideration now |
# If we are 'suspended' then we recieve this | ||
# signal from i3status and can safely ignore | ||
# it. | ||
if code == -SIGUSR2: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry if it should be obvious, but why negate the SIGUSR2 value here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was an odd thing but is no longer needed as we do not send the SIGUSR2 to i3status now. Maybe an i3status bug?
You guys baffle me 👀 quick question and I'll merge. Thanks |
def preexec(): | ||
# Ignore the SIGUSR2 signal for this subprocess | ||
signal(SIGUSR2, SIG_IGN) | ||
|
||
i3status_pipe = Popen( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not self.i3status_pipe here directly ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've moved this into the Popen def is that what you meant?
I've updated this should be better now |
Thank you, yes. |
By default i3bar sends a -SIGSTOP to a process sending it data. This causes
some modules interacting with i3 ipc to be suspended, which lead to locking
issues inside i3. This patch switches to using SIGUSR2 as the suspend
signal.
The async modules eg window_title_async were affected.
see #253