all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: emacs-devel@gnu.org
Subject: Re: dbus-call-method blocks for a long time
Date: Fri, 15 Feb 2013 11:48:04 +0100	[thread overview]
Message-ID: <87y5ep3laz.fsf@gmx.de> (raw)
In-Reply-To: <87r4kiiunq.fsf@fimbulvetr.bsc.es> ("Lluís"'s message of "Thu, 14 Feb 2013 20:04:41 +0100")

Lluís <xscript@gmx.net> writes:

Hi Lluís,

> I'm not quite sure if this is an issue with `notifications' but this piece of
> code is getting my emacs completely frozen for a while every time it calls
> `notifications-notify' (sometimes not even C-g gets out of it):
>
> #v+
> (defun gnus-notifications-notify (from subject photo-file)
>   "Send a notification about a new mail.
> Return a notification id if any, or t on success."
>   (if (fboundp 'notifications-notify)
>       (gnus-funcall-no-warning
>        'notifications-notify
>        :title from
>        :body subject
>        :actions '("read" "Read")
>        :on-action 'gnus-notifications-action
>        :app-icon (gnus-funcall-no-warning
> 		  'image-search-load-path "gnus/gnus.png")
>        :app-name "Gnus"
>        :category "email.arrived"
>        :timeout gnus-notifications-timeout
>        :image-path photo-file)
>     (message "New message from %s: %s" from subject)
>     ;; Don't return an id
>     t))
> #v-

`notifications-notify' doesn't set a timeout for `dbus-call-method' and
`dbus-get-name-owner' (maybe they should). Therefore, the default
timeout of D-Bus is used, which is 25,000 milliseconds. And indeed, both
functions wait exactly this time:

> dbus-call-method                      6           150.09408380  25.015680634
> dbus-get-name-owner                   3           75.051887114  25.017295704

> Looks strange to me that `dbus-call-method' takes so long while the notification
> message appears immediately on my screen.

This is really strange. When the notification appears on your desktop,
`dbus-call-method' has been applied successfully. But Emacs does not
receive the return message of that call.

> Does this sound like a problem in Emacs's DBus immplementation, or should I
> rather look in another direction?

Do you have some special settings wrt D-Bus? For example, do you play
with $DBUS_SESSION_BUS_ADDRESS, or do you use a private D-Bus
connection?

Could you trace D-Bus events in a shell outside Emacs, by calling
"dbus-monitor"? In parallel, you might also trace D-Bus events inside
Emacs by setting `dbus-debug' to `t'.

> Thanks,
>   Lluis

Best regards, Michael.



  reply	other threads:[~2013-02-15 10:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-14 19:04 dbus-call-method blocks for a long time Lluís
2013-02-15 10:48 ` Michael Albinus [this message]
2013-02-15 17:43   ` Lluís

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y5ep3laz.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.