Thread (1 message) 1 message, 1 author, 2017-06-09

Re: send-email: Net::SMTP::SSL failure

From: Junio C Hamano <hidden>
Date: 2017-06-09 16:37:16

Ævar Arnfjörð Bjarmason [off-list ref] writes:
I have not looked deeply at this, but the error you're getting means
"we tried to load it before and failed, and here you are trying
again".

This is almost definitely due to this line in git-send-email:

        if (eval { require Net::SMTP; 1 }) {

And more generally, this code is all buggy:

    4 matches for "eval.*require" in buffer: git-send-email.perl
    153:my $have_email_valid = eval { require Email::Valid; 1 };
    154:my $have_mail_address = eval { require Mail::Address; 1 };
   1118:        if (eval { require Net::Domain; 1 }) {
   1129:        if (eval { require Net::SMTP; 1 }) {

Well, "buggy" in the sense that we're just happy-go-lucky trying to
load these modules, and if they have an error we don't report it, then
when we try to load them again perl just emits a generic error saying
you're trying to require() something that already failed somewhere
before...
Thanks for the discussion.  My short summary from reading the thread
from the sideline is:

 * "eval { require module; 1 }" pattern seems to have spread by
   copying and pasting without thinking, all of which should be
   corrected not to retry;

 * The error OP encountered is not an issue in git-send-email
   per-se, but was made harder to diagnose due to the above.

I think we still lack the definite "here is the right way to fix
these not to retry" patch for application, but anything else I
missed?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help