help

2022-05-24 Thread Jose Antonio Ortega Ruiz


___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [bug] possible condition depending on uninitialized value in _notmuch_message_sync

2022-05-24 Thread Eliza Velasquez
On Fri, May 20 2022 at 09:46 -03, David Bremner  wrote:

> Eliza Velasquez  writes:
>
>> On Mon, May 16 2022 at 06:47 -03, David Bremner  wrote:
>>
>>> Ideally of course I'd like a reproducer in C.  It would help to have
>>> line numbers in the valgrind output. It might be enough you install the
>>> notmuch debug symbols?
>>
>> Took me a while to figure out the debugging workflow in NixOS, but I
>> managed to capture the line numbers. At messsage.cc:1333, at the second
>> condition below:
>>
> [snip]
>> So I guess `message->modified' isn't correctly initialized, at least
>> according to valgrind.
>>
>> -- 
>> Eliza
>
> Can you see if the following change quiets valgrind?
>
> diff --git a/lib/message.cc b/lib/message.cc
> index 63b216b6..bd3cb5af 100644
> --- a/lib/message.cc
> +++ b/lib/message.cc
> @@ -169,6 +169,7 @@ _notmuch_message_create_for_document (const void 
> *talloc_owner,
>  
>  message->doc = doc;
>  message->termpos = 0;
> +message->modified = FALSE;
>  
>  return message;
>  }

That seems to have fixed it. Valgrind is very pleased with all of the
test cases now :)
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [BUG] notmuch_message_tags_to_maildir_flags does not always invalidate filenames_list

2022-05-24 Thread Eliza Velasquez
On Tue, May 24 2022 at 09:45 -03, David Bremner  wrote:

> Eliza Velasquez  writes:
>
>> Hello notmuch,
>>
>> As the subject says, it seems like the filename cache for a message is
>> not reliably invalidated when notmuch_message_tags_to_maildir_flags is
>> called, causing the following series of function calls to behave
>> unexpectedly.
>>
>> - notmuch_database_index_file
>> - notmuch_message_get_filenames
>> - notmuch_message_tags_to_maildir_flags
>> - notmuch_message_get_filenames (stale list returned)
>>
>> According to the investigator [1], this happens about 10% of the time,
>> but it's possible that this is just because there is some quirk in the
>> client-side code causing it to trigger only sometimes.
>>
>> [1] https://github.com/elizagamedev/mujmap/pull/10#issuecomment-1131587169
>>
>
> I have been looking at this code, and making some small improvements [1],
> but without a C reproducer I don't really know if it helps the
> submitter's issue.
>
> d
>
> [1]: 
> https://nmbug.notmuchmail.org/nmweb/show/20220523233901.3506880-1-da...@tethera.net

Thank you for looking into this and putting out such a quick patch, I
really appreciate it. It turns out the core issue that we were
encountering actually seems like it's due to cache propagation issues
across message instances, according to the investigator (Rob). To quote:

> I think its a fairly standard cache write propagation issue, with the
> outstanding message objects as the caches. Whether or not its a bug in
> notmuch itself I think is entirely down to whether holding and
> modifying multiple message objects for the "same" record (with
> duplicates) is supposed to work or not. I'm in two minds about it; on
> the one hand, multiple message objects is clearly a valid use case
> (queries!), on the other, playing with the mail files themselves is a
> bit of a niche feature. I'll think about it a bit more and maybe take
> it up to the notmuch list myself.

He wrote a more detailed writeup of it as well [1], which includes a
minimal reproducible test case written in C. After reviewing this, I'm
also not sure whether or not this should be considered a notmuch bug,
but it was surprising behavior.

[1] https://gist.github.com/robn/a56420062127238f57541eb47bc962f5
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: moving mail to another maildir based on tags and renaming files

2022-05-24 Thread erik colson
David Bremner  writes:

> There is in fact the "notmuch dump" command. I recommend everyone who
> invests (human) effort in tagging uses it regularly. The output is much
> smaller than the notmuch database.

awesome! thx
-- 
erik colson
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [BUG] notmuch_message_tags_to_maildir_flags does not always invalidate filenames_list

2022-05-24 Thread David Bremner
Eliza Velasquez  writes:

> Hello notmuch,
>
> As the subject says, it seems like the filename cache for a message is
> not reliably invalidated when notmuch_message_tags_to_maildir_flags is
> called, causing the following series of function calls to behave
> unexpectedly.
>
> - notmuch_database_index_file
> - notmuch_message_get_filenames
> - notmuch_message_tags_to_maildir_flags
> - notmuch_message_get_filenames (stale list returned)
>
> According to the investigator [1], this happens about 10% of the time,
> but it's possible that this is just because there is some quirk in the
> client-side code causing it to trigger only sometimes.
>
> [1] https://github.com/elizagamedev/mujmap/pull/10#issuecomment-1131587169
>

I have been looking at this code, and making some small improvements [1],
but without a C reproducer I don't really know if it helps the
submitter's issue.

d

[1]: 
https://nmbug.notmuchmail.org/nmweb/show/20220523233901.3506880-1-da...@tethera.net
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: moving mail to another maildir based on tags and renaming files

2022-05-24 Thread David Bremner
erik colson  writes:

> With notmuch my idea is to bundle the subfolders in the mainfolder so
> that would roughly divide the mailboxes by at least 5.  With notmuch the
> subfolders are definitely to be tags.  I want to keep the folder for
> every project to at least have some kind of fallback in case the notmuch
> database gets corrupt..  That is my most important fear with notmuch ;)
>
> I was thinking if notmuch offers some kind of 'dump' for the database,
> so it can eventually be restored ?

There is in fact the "notmuch dump" command. I recommend everyone who
invests (human) effort in tagging uses it regularly. The output is much
smaller than the notmuch database.

d
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: moving mail to another maildir based on tags and renaming files

2022-05-24 Thread erik colson
"inwit"  writes:

> Yeah, that is correct. But it proved trickier than it seemed to me (thus the
> safeMove2 attempt). 

Yes, I have seen that

> I must confess that I've holding this tag/folder scheme for over a year now, 
> and
> that I'm more and more inclined to reduce the amount of folders that I keep
> (I've recently fused 3 or 4 of my biggest folders into Archive, for example).
> I'm trying to reduce my use of portable devices, and the truth is that search
> engines offered by webmail are slowly getting better, so I feel less exposed 
> by
> not having my mail ranged in folders. I guess the whole tag-based paradigm is
> also settling down on my mind, although I still feel that its nowadays a bit 
> odd
> to rely on a single local copy instead of a cloud-based solution. For this 
> last
> problem, there have been some interesting developments recently that I need to
> investigate (precisely, the nmbug evolution).

I have 1000+ mailboxes linked to projects.  Every project gets a number
and every 'subject' in the project gets its own subfolder.  Take that
down 20+ years and you get 1000+ folders ;)

With notmuch my idea is to bundle the subfolders in the mainfolder so
that would roughly divide the mailboxes by at least 5.  With notmuch the
subfolders are definitely to be tags.  I want to keep the folder for
every project to at least have some kind of fallback in case the notmuch
database gets corrupt..  That is my most important fear with notmuch ;)

I was thinking if notmuch offers some kind of 'dump' for the database,
so it can eventually be restored ?

> Anyway, notmuch rocks. :)

quite a lot, in fact !
-- 
erik colson
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: moving mail to another maildir based on tags and renaming files

2022-05-24 Thread inwit
On Tue May 24, 2022 at 12:01 AM CEST, erik colson wrote:
> Do I understand correctly that I only have to remove the U=... part from
> the filename when moving a message?  That seems so easy I hardly believe
> it ;)

Yeah, that is correct. But it proved trickier than it seemed to me (thus the
safeMove2 attempt). 

I must confess that I've holding this tag/folder scheme for over a year now, and
that I'm more and more inclined to reduce the amount of folders that I keep
(I've recently fused 3 or 4 of my biggest folders into Archive, for example).
I'm trying to reduce my use of portable devices, and the truth is that search
engines offered by webmail are slowly getting better, so I feel less exposed by
not having my mail ranged in folders. I guess the whole tag-based paradigm is
also settling down on my mind, although I still feel that its nowadays a bit odd
to rely on a single local copy instead of a cloud-based solution. For this last
problem, there have been some interesting developments recently that I need to
investigate (precisely, the nmbug evolution).

Anyway, notmuch rocks. :)
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: moving mail to another maildir based on tags and renaming files

2022-05-24 Thread erik colson
João Pedro  writes:

> Best regards (and sorry for the long mail),

Hi João,

Thanks for all the explanations and your config!  I will tend to script,
things in fish but meanwhile your code does help a lot!

best
-- 
erik colson
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org