You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@spamassassin.apache.org on 2021/10/06 05:07:42 UTC

[Bug 7934] New: archive-iterator errors in sa-learn when something else marks messages as read in maildir

https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7934

            Bug ID: 7934
           Summary: archive-iterator errors in sa-learn when something
                    else marks messages as read in maildir
           Product: Spamassassin
           Version: 3.4.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Learner
          Assignee: dev@spamassassin.apache.org
          Reporter: david@mandelberg.org
  Target Milestone: Undefined

If I run sa-learn on the cur folder of a Maildir, and simultaneously mark an
unread message as read in that same Maildir, I get errors like this:

archive-iterator: unable to open [redacted]:2,: No such file or directory

Looking at
https://github.com/apache/spamassassin/blob/spamassassin_release_3_4_6/lib/Mail/SpamAssassin/ArchiveIterator.pm
I think what's happening is that _scan_targets is finding all the files before
I mark the message as read, then _run is iterating through those messages. I
think that while _run is iterating through the messages, marking a message as
read renames the file, and when _run_file is called on that file, it calls
_mail_open, which fails to open the old filename. It looks like right below
where _run_file calls _mail_open,
https://github.com/apache/spamassassin/blob/4a1fe99da9296364be0c50f02d2a73b5af74207a/lib/Mail/SpamAssassin/ArchiveIterator.pm#L354-L357
checks if the file exists, and ignores it if it doesn't. Should that check
happen before the call to _mail_open? I'm not used to perl though, so I'm not
confident I understood that correctly.

Would it be possible to ignore files that disappear from a Maildir while
sa-learn is running? Or maybe scan for files and run at the same time, to
shorten the window for this problem happening?

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7934] archive-iterator errors in sa-learn when something else marks messages as read in maildir

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7934

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |apache@hege.li

--- Comment #1 from Henrik Krohns <ap...@hege.li> ---
Yeah the code is a bit convoluted..

To properly ignore disappeared maildir files, _run_message/_run_file need to be
passed info that Maildir is being handled and act accordingly, otherwise it
might not warn for other cases of missing files.

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 7934] archive-iterator errors in sa-learn when something else marks messages as read in maildir

Posted by bu...@spamassassin.apache.org.
https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7934

Henrik Krohns <ap...@hege.li> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Henrik Krohns <ap...@hege.li> ---
Disappeared files should no longer emit warnings:

Sending        trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm
Transmitting file data .done
Committing transaction...
Committed revision 1899836.

-- 
You are receiving this mail because:
You are the assignee for the bug.