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

Hooks > onStart delay Guake start by ~100s #1982

Closed
cmalard opened this issue Nov 24, 2021 · 10 comments · Fixed by #2068
Closed

Hooks > onStart delay Guake start by ~100s #1982

cmalard opened this issue Nov 24, 2021 · 10 comments · Fixed by #2068

Comments

@cmalard
Copy link

cmalard commented Nov 24, 2021

Describe the bug

Hooks -> onStart makes Guake opening laggy
Content of my script:

#!/bin/sh
guake --execute-command 'htop'
guake --new-tab ' '

If I try to run the start command by myself through terminal after closing Guake:

$ sh -c ~/Dropbox/install/dotfiles/guake-start.sh
Guake not running, starting it
Loading Gnome schema from: /usr/lib/python3/dist-packages/guake/data
Language previously loaded from: /usr/lib/python3/dist-packages/locale
Guake Terminal 3.8.1
VTE 0.64.2
Gtk 3.24.30
created fresh notebook for workspace 0
Spawning new terminal at /home/cedric

(guake:279208): VTE-WARNING **: 22:23:08.956: (../src/vtepty.cc:690):bool _vte_pty_spawn_sync(VtePty*, const char*, const char* const*, const char* const*, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, GPid*, int, GCancellable*, GError**): runtime check failed: ((spawn_flags & ignored_spawn_flags()) == 0)
current workspace is 0
can't bind show-focus key
Guake initialized
Calling startup script: ~/Dropbox/install/dotfiles/guake-start.sh
Startup script started with pid: <Popen: returncode: None args: ['~/Dropbox/install/dotfiles/guake-start.sh']>
ERROR:dbus.proxies:Introspect error on :1.637:/org/guake3/RemoteControl: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib/python3/dist-packages/guake/main.py", line 616, in exec_main
    if not main():
  File "/usr/lib/python3/dist-packages/guake/main.py", line 535, in main
    remote_object.execute_command(options.command)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
ERROR:dbus.proxies:Introspect error on :1.637:/org/guake3/RemoteControl: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib/python3/dist-packages/guake/main.py", line 616, in exec_main
    if not main():
  File "/usr/lib/python3/dist-packages/guake/main.py", line 490, in main
    remote_object.add_tab(options.new_tab)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Spawning new terminal at  

(guake:279208): VTE-WARNING **: 22:24:49.652: (../src/vtepty.cc:690):bool _vte_pty_spawn_sync(VtePty*, const char*, const char* const*, const char* const*, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, GPid*, int, GCancellable*, GError**): runtime check failed: ((spawn_flags & ignored_spawn_flags()) == 0)
Spawning new terminal at /home/cedric

(guake:279208): VTE-WARNING **: 22:24:50.228: (../src/vtepty.cc:690):bool _vte_pty_spawn_sync(VtePty*, const char*, const char* const*, const char* const*, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, GPid*, int, GCancellable*, GError**): runtime check failed: ((spawn_flags & ignored_spawn_flags()) == 0)

image

After ~100s, Guake opens with htop & a second time as asked.

Expected behavior

Hooks -> onStart works instantly.

Actual behavior

Look like there is some issue and some timeout happens.

To Reproduce

Add a on start hook, re-start Guake.


$ guake --support

Guake Version: 3.8.1

Vte Version: 0.64.2

Vte Runtime Version: 0.64.2


GTK+ Version: 3.24.30

GDK Backend: <GdkX11.X11Display


Desktop Session: ubuntu-xorg


Display: :0

RGBA visual: True

Composited: True

  • Monitor: 0 - SDC eDP-1
    • Geometry: 1920 x 1080 at 0, 1080
    • Size: 344 x 194 mm²
    • Primary: True
    • Refresh rate: 59.962 Hz
    • Subpixel layout: unknown
  • Monitor: 1 - IVM HDMI-1
    • Geometry: 1920 x 1080 at 0, 0
    • Size: 544 x 303 mm²
    • Primary: False
    • Refresh rate: 60.0 Hz
    • Subpixel layout: unknown
@Davidy22
Copy link
Collaborator

guake-toggle is purpose written as a dedicated way to open guake that's faster than just running guake. Does that work for you?

@cmalard
Copy link
Author

cmalard commented Nov 25, 2021

Nop, not related, that's 100% linked to the hook "on start".
As soon as I disable it, Guake instantly appears ;-)

I did not had this issue some months ago, can't tell if it's linked to my upgrade Ubuntu 20.*>21.10 or if it's from Guake

But ty for the tip, that'll help when I'll switch back to Wayland :-)

@Davidy22
Copy link
Collaborator

Oh, you mean the startup scripts with guake? Just out of curiosity, how fast do the individual commands run for you? If you run

guake --execute-command 'htop'
guake --new-tab ' '

Individually outside of a startup script, are they slow?

@cmalard
Copy link
Author

cmalard commented Nov 25, 2021

it's instant ;-)

@Davidy22
Copy link
Collaborator

Hum, do other, non-guake related commands in the startup script lag on startup? I'd suspect the slow part is in startup script running code if the commands are fast

@cmalard
Copy link
Author

cmalard commented Nov 25, 2021

not sure how to properly test it, but an echo "lol" was instant 🙃

@Davidy22
Copy link
Collaborator

Since you're able to run the script and reproduce the slowdown in terminal, try:

#!/bin/sh
time guake --execute-command 'htop'
time guake --new-tab ' '

and we should hopefully get a little more info on where the slowdown is

@cmalard
Copy link
Author

cmalard commented Nov 26, 2021

or not 🙈 🍻

$ guake
Guake not running, starting it
Loading Gnome schema from: /usr/lib/python3/dist-packages/guake/data
Language previously loaded from: /usr/lib/python3/dist-packages/locale
Guake Terminal 3.8.1
VTE 0.64.2
Gtk 3.24.30
created fresh notebook for workspace 0
Spawning new terminal at /home/cedric

(guake:234253): VTE-WARNING **: 16:45:39.329: (../src/vtepty.cc:690):bool _vte_pty_spawn_sync(VtePty*, const char*, const char* const*, const char* const*, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, GPid*, int, GCancellable*, GError**): runtime check failed: ((spawn_flags & ignored_spawn_flags()) == 0)
current workspace is 0
can't bind show-focus key
Guake initialized
Calling startup script: ~/Dropbox/install/dotfiles/guake-start.sh
Startup script started with pid: <Popen: returncode: None args: ['~/Dropbox/install/dotfiles/guake-start.sh']>
ERROR:dbus.proxies:Introspect error on :1.402:/org/guake3/RemoteControl: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib/python3/dist-packages/guake/main.py", line 616, in exec_main
    if not main():
  File "/usr/lib/python3/dist-packages/guake/main.py", line 535, in main
    remote_object.execute_command(options.command)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Command exited with non-zero status 1
0.22user 0.02system 0:50.30elapsed 0%CPU (0avgtext+0avgdata 45904maxresident)k
0inputs+0outputs (0major+5454minor)pagefaults 0swaps

ERROR:dbus.proxies:Introspect error on :1.402:/org/guake3/RemoteControl: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Traceback (most recent call last):
  File "/usr/bin/guake", line 10, in <module>
    sys.exit(exec_main())
  File "/usr/lib/python3/dist-packages/guake/main.py", line 616, in exec_main
    if not main():
  File "/usr/lib/python3/dist-packages/guake/main.py", line 490, in main
    remote_object.add_tab(options.new_tab)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Command exited with non-zero status 1
0.18user 0.03system 0:50.27elapsed 0%CPU (0avgtext+0avgdata 46004maxresident)k
0inputs+0outputs (0major+5450minor)pagefaults 0swaps

Spawning new terminal at  

(guake:234253): VTE-WARNING **: 16:47:20.055: (../src/vtepty.cc:690):bool _vte_pty_spawn_sync(VtePty*, const char*, const char* const*, const char* const*, GSpawnFlags, GSpawnChildSetupFunc, gpointer, GDestroyNotify, GPid*, int, GCancellable*, GError**): runtime check failed: ((spawn_flags & ignored_spawn_flags()) == 0)

If I directly call the script once Guake is started:

$ sh -c ~/Dropbox/install/dotfiles/guake-start.sh
htop
0.13user 0.02system 0:00.16elapsed 96%CPU (0avgtext+0avgdata 36152maxresident)k
0inputs+0outputs (0major+4106minor)pagefaults 0swaps
0.13user 0.01system 0:00.18elapsed 78%CPU (0avgtext+0avgdata 36020maxresident)k
0inputs+0outputs (0major+4104minor)pagefaults 0swaps

@Davidy22
Copy link
Collaborator

oh no this is still good, tells us that the time's being spent on the commands and it's not some overhead with the startup script caller, the split in the middle tells us that there was one dbus wait per and it wasn't two dbus exceptions on one command or something, so the slowdown is probably directly called by those dbus exceptions happening. Now just to figure out how to fix this.

@torson
Copy link

torson commented Apr 2, 2022

I've worked around this by running the "On start" command as a background job by adding & at the end:

guake_startup.sh &

No added sleep at the start of script required .
Seems there's some deadlock on initialization when Guake management commands are inside the "On start" script. Guake waits for the script to finish and is not responding to the script Guake management commands.

This is on latest 3.8.1-1~ppa~bionic2 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants