unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Gaute Hope <eg@gaute.vetsj.com>
To: David Bremner <david@tethera.net>, notmuch <notmuch@notmuchmail.org>
Subject: Re: DatabaseModifiedErrors causing troubles
Date: Sat, 17 Jan 2015 15:12:05 +0000	[thread overview]
Message-ID: <1421507092-astroid-4-sde37j1ij5-1327@strange> (raw)
In-Reply-To: <87fvb9bnf8.fsf@maritornes.cs.unb.ca>

Excerpts from David Bremner's message of January 17, 2015 13:29:
> Gaute Hope <eg@gaute.vetsj.com> writes:
>
>>
>> Hi David,
>>
>> Would it be possible with an error code that I could compare against in
>> stead? It would then work a bit like a global instance of the gmime
>> error. It could even be a preparation step against a gmime-error-style
>> solution in the far future.
>>
>> I am sure you know all the bad reasons for using a strcmp with strings
>> such as small (subtle) changes making them useless or future
>> localization of notmuch. This solution is in my opinion worse than the
>> current situation, it will lock things in and create problems for future
>> API compatability and application maintainers. I would rather wait for
>> or spend some time on a more general solution.
>
> I don't agree it's worse than the current situation but I take your
> point it isn't ideal.  We could do some kind "errno" in the database
> structure.  I think there are not that many functions with this
> unhelpful error return type. Based on a scan of notmuch.h, I see
>
> notmuch_query_search_threads
> notmuch_query_search_messages
>
> and the two count functions that I already posted API breaking patches
> for.  It might be better just to update the API (either adding versions
> with error returns, or just forcing people to change) for these
> functions.  Otherwise we have two different ways of returning status
> codes, and the "errno" is only used some of the time.

Yeah - a consistent way of doing this would in my opinion be very
useful. Also, many other functions could be affected by outside
processes as well (notmuch new, notmuch tag) that do not necessarily
violate the thread-safety restrictions on xapian / notmuch. Errors in
these functions, and importantly which error, are currently hard to
catch and identify (say notmuch_messages_move_to_next). The same error
reporting system could be used for these. With a flexible error system
we could fix these as they are discovered.

Cheers, Gaute


      reply	other threads:[~2015-01-17 15:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 12:17 DatabaseModifiedErrors causing troubles Gaute Hope
2014-08-21  8:59 ` Gaute Hope
2014-08-21  9:01   ` Gaute Hope
2014-12-31  8:28 ` David Bremner
2015-01-17 11:18   ` Gaute Hope
2015-01-17 12:29     ` David Bremner
2015-01-17 15:12       ` Gaute Hope [this message]

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://notmuchmail.org/

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

  git send-email \
    --in-reply-to=1421507092-astroid-4-sde37j1ij5-1327@strange \
    --to=eg@gaute.vetsj.com \
    --cc=david@tethera.net \
    --cc=notmuch@notmuchmail.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 public inbox

	https://yhetil.org/notmuch.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).