unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Colascione <dancol@dancol.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: trunk r116499: Improve dbus error handling; detect bus failure
Date: Mon, 24 Feb 2014 00:24:35 -0800	[thread overview]
Message-ID: <530B01C3.5010209@dancol.org> (raw)
In-Reply-To: <87ha7ogbz8.fsf@gmx.de>

This change is a bug fix --- a non-trivial bug fix, but a bug fix. 
There's no contractual behavior change.

On 02/24/2014 12:18 AM, Michael Albinus wrote:
> Daniel Colascione <dan.colascione@gmail.com> writes:
>
>> +	(dbus-handle-bus-disconnect): New function.  React to bus
>> +	disconnection signal by synthesizing dbus error for each
>> +	pending synchronous or asynchronous call.
>
> This is a new functionality. Why do you want to add it during feature
> freeze? And what is the reasoning behind? When a D-Bus bus disconnects,
> there might be more serious problems but pending method calls.

And you would propose to just ignore bus disconnects? Sending an error 
is the best we can do.

> Is it about performance, and abortion of such pending calls? When does
> it happen, that a bus disconnect for you?

It's not about performance, but since I had to restructure the code to 
handle errors anyway, I used a mechanism that doesn't involve so many 
hash table lookups.

>
>> +	(dbus-notice-synchronous-call-errors): New function.
>> +	(dbus-handle-event): Raise errors directly only when `dbus-debug'
>> +	is true, not all the time.
>
> Why that? You cannot assume that `dbus-event-error-functions' is non-nil
> (and contains `dbus-notice-synchronous-call-errors').

We still call dbus-event-error-functions.  In fact, that's how error 
propagation to synchronous calls works now.

> I still don't see what you are trying to resolve. Lisp errors are shown
> when happening in handlers, what else do you want to achieve? As usual a
> typical use case would help.

First of all, before my change, the dbus could would just hang in 
response to bus disconnects. Now calls terminate immediately with a 
reasonable error. dbus disconnects the bus on certain usage errors. Here 
is a call that results in an immediate bus disconnect:

(dbus-call-method :session "org.freedesktop.secrets" 
"/org/freedesktop/secrets/collection/login" 
"org.freedesktop.Secret.Collection" "SearchItems" '(:array (:dict-entry 
"host" ("xxxx" "xxxx")) (:dict-entry "port" "imaps")))

Additionally, I strongly dislike signaling errors from the read-event 
handler: doing that makes it easy to "leak" errors up to unrelated outer 
dbus calls. Please carefully consider cases where more than one dbus 
call might be pending on the stack at a time.

> And *if* you are applying such changes, I would expect respective doc
> changes, for example explainig the (changed) structure of the values in
> `dbus-return-values-table', or mentioning
> `dbus-notice-synchronous-call-errors' and its intended use in dbus.texi.

Neither of these symbols is public. The contractual behavior has not 
changed.




  reply	other threads:[~2014-02-24  8:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1WGhnF-0006bq-Ma@vcs.savannah.gnu.org>
2014-02-24  8:18 ` trunk r116499: Improve dbus error handling; detect bus failure Michael Albinus
2014-02-24  8:24   ` Daniel Colascione [this message]
2014-02-24  8:54     ` Michael Albinus
2014-02-24 11:45       ` Peter Münster
2014-02-24 12:50         ` Daniel Colascione
2014-02-24 12:59           ` Daniel Colascione
2014-02-24 13:09           ` Michael Albinus
2014-02-24 13:14             ` Michael Albinus
2014-02-24 13:48               ` Daniel Colascione
2014-02-24 14:25                 ` Michael Albinus
2014-02-24 18:52                   ` Peter Münster

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=530B01C3.5010209@dancol.org \
    --to=dancol@dancol.org \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).