Re: RFC: git send-email and error handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11-04-14 05:09 PM, Jeff King wrote:
> On Thu, Apr 14, 2011 at 04:10:12PM -0400, Paul Gortmaker wrote:
> 
>> The command line (git 1.7.4.4) is typically something like:
>>
>> git send-email --to stable@xxxxxxxxxx --to linux-kernel@xxxxxxxxxxxxxxx \
>>    --cc stable-review@xxxxxxxxxx   some_patch_dir
>>
>> So, let me get to what happened today:  After sending 113 out of 209
>> patches, it came to the 114th patch, and gave me this:
>>
>> (mbox) Adding cc: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx> from line 'From: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>'
>> (body) Adding cc: Dmitry Torokhov <dtor@xxxxxxx> from line 'Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>'
>> (body) Adding cc: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx> from line 'Signed-off-by: Paul Gortmaker <paul.gortmaker@xxxxxxxxxxxxx>'
>> 5.2.1 <dtor@xxxxxxx>... Mailbox disabled for this recipient
>>
>> Then, taking that as a hard error, it simply exited,
>> leaving me scrambling to figure out how to quickly fix the
>> offending patch and continue with the unsent queue.
> 
> I suspect part of the issue is that your mail setup is unlike that of
> most people. Usually, we would deliver to some local MTA (either by SMTP
> directly, by sendmail that speaks SMTP to a smarthost, or by sendmail
> that queues directly); that MTA would queue the message in a spool for
> you, and attempt delivery asynchronously.  So the errors generally come
> all or nothing. You can queue mail, or you can't, and trying again and
> again after each error is just wasteful and annoying. Eventual errors
> are reported back to you as bounces.
> 
> Your setup seems different; it looks like your sendmail (or the SMTP
> server you connect to) actually routes the mail without queueing at all,
> and you synchronously get the final word on whether it can be delivered.
> Or maybe it just connects to the recipient site and checks that "RCPT
> TO" works before actually queueing. It's hard to say from the snippet
> above. What's your MTA?

Yes, the above is true -- I'm not queuing anything locally or involving
a local MTA.  I've set sendemail.smtpserver in my ~/.gitconfig to the
hostname of an infrastructural server running sendmail (telnet 25 doesnt
show me what version, but I'm told it is sendmail).  This configuration
gives me the most portability to run on any random machine within our
org without having to wonder if it has a locally installed and correctly
configured MTA -- it works so well, I've even abused git send-email to
dispatch random (non-patch) mails from ad-hoc scripts on occasions, simply
because I know everyone has git installed somewhere in $PATH.

> 
> I can see in your case how it would be preferable to keep going through
> the list and then assemble a set of errors at the end. But that should
> be configurable, because most setups won't want that behavior.
> 
>>  From my point of view, the right thing to do here would have
>> been to ignore the error on the harvested mail address, and continue
>> on through the rest of the queue.
> 
> It's a little tricky, because send-email may not know the details of
> what happened, especially if this behavior comes from a sendmail
> wrapper rather than SMTP. We dump the message and a list of recipients
> to an external program, and then get back a "yes it was sent" or "no it
> was not" code. So we can't do anything clever, like say "Well, it was
> sent, but not to one particular address, but that's OK because that
> address was auto-harvested from a signed-off-by line".

True.  I wonder if there is some flexibility in what we do, depending
on whether the setting is a local binary like /usr/bin/sendmail, vs.
a hostname of a server, like it was in my case...

> 
> Whether we can do better depends on your MTA. _If_ you are sending via
> SMTP, and _if_ it will reject particular recipients at the time of "rcpt
> to", then we could do something that clever. Given that the 5.2.1
> message appeared on your terminal, and that it should not have been
> generated by git-send-email, that implies to me you are using the local
> sendmail binary.
> 
>> Or even interactively ask me what to do when it saw the 5.2.1 failure.
>> But maybe that wouldn't be right for everyone.  I didn't see anything
>> in the GSE man page that would let me configure this behaviour either.
> 
> The problem there is that the message probably was not actually sent (or
> at least, sendmail presumably returned an error code to git, which is
> why git stopped). And you, as a human, saw that the error was something
> survivable. But you can't just tell git "it's OK to continue". You need
> to actually fix the problem and re-send, which means telling git that
> the one particular address is not interesting. And that is a lot more
> interface than just yes/no.
> 
> I would think what you really want is a system that tries to send
> everything, keeps track of which recipients are to receive which
> message, and then marks success or failure for each. At the end, you
> would find that dtor@xxxxxxx didn't receive anything, and realize you
> don't care. And you don't have to worry about restarting a failed
> send-email and sending duplicates. You know who got what.
> 
> If that sounds good, then you should consider switching MTAs, because
> that is exactly what the job of an MTA is. :)

I could set up a local queue, and for the big batches of patches I
may do that, but the portability of having sendemail.smtpserver pointing
at a host instead of a program is too nice for me to be willing to
give that up globally.

P.

> 
> -Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]