scorpion-26 / gBar

Blazingly fast status bar written with GTK
MIT License
478 stars 17 forks source link

High load makes gBar exit cleanly. #32

Open kragebein opened 1 year ago

kragebein commented 1 year ago

Describe the bug gBar exits when because it couldnt write to socket.

Steps to Reproduce Produce high load.

Expected behavior Would expect gBar to continue to work, but it doesnt get an immediate response from the socket, and thinks its unavailable. Should probably have a timeout, and recheck it the socket is actually available or just slow. Socket is definitively available, I just have a shitty low owered corporate laptop.

Screenshots/Error logs (gBar:19420): Gtk-CRITICAL **: 11:39:46.202: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed SNI: Add :1.10 to widget SNI: Add :1.17 to widget SNI: Add :1.306 to widget SNI: Add :1.6 to widget SNI: Add :1.68 to widget SNI: Add :1.70 to widget SNI: Add :1.72 to widget SNI: Add :1.9 to widget SNI: Add org.kde.StatusNotifierItem-1877-1 to widget Couldn't write to socket [Exiting due to assert failed]

Information about your system and gBar

kragebein commented 1 year ago

Just a note to this, i have a shitty work computer. And everytime i compile anything and produce load, gBar will exit because it cant write to socket. So i cant really tell if its due to high load or high I/O - either way, it is consistent.

ssize_t written = write(hyprSocket, arg.c_str(), arg.size()); ASSERT(written >= 0, "Couldn't write to socket");

Here you seem to check if you have written something to the socket, i dont think assert is great here, should check if something is written, and if not, call it self and try again a few times maybe ?

scorpion-26 commented 1 year ago

All hyprland socket operations are now retried 5 times, and don't crash even if they fail. I can't seem to reproduce this, neither on my desktop running prime95, nor on my low-powered laptop compiling on all cores. So it seems, that it is due to high I/O. If the commit doesn't fix things, you should proably disable UseHyprlandIPC, so the workspace traffic goes over Wayland instead.

koaledu commented 3 months ago

gBar tries really hard to connect to the Hyprland socket but fails and ends crashing at start. When launching from terminal, does not crash.

image

scorpion-26 commented 3 months ago

gBar tries really hard to connect to the Hyprland socket but fails and ends crashing at start. When launching from terminal, does not crash.

Hyprland changed the socket address recently, which should be fixed in 89585255fd8c9368bf7e62309c60068edf4cf245