git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 1/6] send-email: Add --delay for separating emails
@ 2009-04-07 21:25 Michael Witten
  2009-04-07 21:51 ` Jeff King
  2009-04-07 23:17 ` Junio C Hamano
  0 siblings, 2 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-07 21:25 UTC (permalink / raw)
  To: git

When sending a patch series, the emails often arrive at the final
destination out of order; though these emails should be chained
via the In-Reply-To headers, some mail-viewing systems display
by order of arrival instead.

The --delay option provides a means for specifying that there
should be a certain number of seconds of delay between sending
emails, so that the arrival order can be controlled better.

Signed-off-by: Michael Witten <mfwitten@gmail.com>
---
 Documentation/git-send-email.txt |    5 +++++
 git-send-email.perl              |   17 +++++++++++++----
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
index 10dfd66..4b656ca 100644
--- a/Documentation/git-send-email.txt
+++ b/Documentation/git-send-email.txt
@@ -97,6 +97,11 @@ The --to option must be repeated for each user you want on the to list.
 Sending
 ~~~~~~~
 
+--delay::
+	Specify the minimum number of seconds of delay that should occur
+	between sending emails. This number should be an integer >= zero.
+	Default is the value of the 'sendemail.delay' configuration variable.
+
 --envelope-sender::
 	Specify the envelope sender used to send the emails.
 	This is useful if your default address is not the address that is
diff --git a/git-send-email.perl b/git-send-email.perl
index 172b53c..273c8c7 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -56,6 +56,7 @@ git send-email [options] <file | directory | rev-list options >
     --compose                      * Open an editor for introduction.
 
   Sending:
+    --delay                 <int>  * Delay (seconds) between sending emails.
     --envelope-sender       <str>  * Email envelope sender.
     --smtp-server       <str:int>  * Outgoing SMTP server to use. The port
                                      is optional. Default 'localhost'.
@@ -180,7 +181,7 @@ sub do_edit {
 }
 
 # Variables with corresponding config settings
-my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);
+my ($delay, $thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);
 my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);
 my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);
 my ($validate, $confirm);
@@ -196,6 +197,7 @@ my %config_bool_settings = (
 );
 
 my %config_settings = (
+    "delay" => \$delay,
     "smtpserver" => \$smtp_server,
     "smtpserverport" => \$smtp_server_port,
     "smtpuser" => \$smtp_authuser,
@@ -247,6 +249,7 @@ my $rc = GetOptions("sender|from=s" => \$sender,
 		    "cc=s" => \@initial_cc,
 		    "bcc=s" => \@bcclist,
 		    "chain-reply-to!" => \$chain_reply_to,
+		    "delay=i" => \$delay,
 		    "smtp-server=s" => \$smtp_server,
 		    "smtp-server-port=s" => \$smtp_server_port,
 		    "smtp-user=s" => \$smtp_authuser,
@@ -973,8 +976,9 @@ $references = $initial_reply_to || '';
 $subject = $initial_subject;
 $message_num = 0;
 
-foreach my $t (@files) {
-	open(F,"<",$t) or die "can't open file $t";
+for (my $index = 0; $index < @files; $index++) {
+	my $file = $files[$index];
+	open(F,"<",$file) or die "can't open file $file";
 
 	my $author = undef;
 	my $author_encoding;
@@ -1083,7 +1087,7 @@ foreach my $t (@files) {
 	close F;
 
 	if (defined $cc_cmd && !$suppress_cc{'cccmd'}) {
-		open(F, "$cc_cmd $t |")
+		open(F, "$cc_cmd $file |")
 			or die "(cc-cmd) Could not execute '$cc_cmd'";
 		while(<F>) {
 			my $c = $_;
@@ -1128,6 +1132,11 @@ foreach my $t (@files) {
 
 	send_message();
 
+	if ($delay && $index < $#files) {
+		my $this_long = $delay;
+		while (($this_long -= sleep $this_long) > 0) {}
+	}
+
 	# set up for the next message
 	if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {
 		$reply_to = $message_id;
-- 
1.6.2.2.448.g61445.dirty

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-07 21:25 [PATCH RFC 1/6] " Michael Witten
@ 2009-04-07 21:51 ` Jeff King
  2009-04-07 23:17 ` Junio C Hamano
  1 sibling, 0 replies; 18+ messages in thread
From: Jeff King @ 2009-04-07 21:51 UTC (permalink / raw)
  To: Michael Witten; +Cc: git

On Tue, Apr 07, 2009 at 04:25:17PM -0500, Michael Witten wrote:

> When sending a patch series, the emails often arrive at the final
> destination out of order; though these emails should be chained
> via the In-Reply-To headers, some mail-viewing systems display
> by order of arrival instead.
> 
> The --delay option provides a means for specifying that there
> should be a certain number of seconds of delay between sending
> emails, so that the arrival order can be controlled better.
> 
> Signed-off-by: Michael Witten <mfwitten@gmail.com>

I'm a little dubious how well this works in practice. Have you done any
experiments?

The reason I am dubious is that you are presumably delaying only a few
seconds (since anything more would be quite annoying to the user). This
may deal with a short race condition in your local mail server. But what
is the real cause of out-of-order delivery? Is it the local mail server
seeing two messages essentially "simultaneously" and then reordering
them randomly? Or is it other random delays that happen _after_ that,
like network congestion, DNS lookups, down or congested servers, time it
takes to deliver the actual message body (e.g., if your mail server
sends two simultaneously, but the first one is much larger and takes
longer to complete), etc.

Those delays can be much larger than a few seconds, and this won't help
at all there.

I think it may still be reasonable to implement a solution that only
covers some of the cases, but I what I am asking is if we know what
percentage of the cases that is. If we are preventing only 1% of
out-of-order deliveries with this, I question whether it is worth the
bother.

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-07 21:25 [PATCH RFC 1/6] " Michael Witten
  2009-04-07 21:51 ` Jeff King
@ 2009-04-07 23:17 ` Junio C Hamano
  1 sibling, 0 replies; 18+ messages in thread
From: Junio C Hamano @ 2009-04-07 23:17 UTC (permalink / raw)
  To: Michael Witten; +Cc: git

Michael Witten <mfwitten@gmail.com> writes:

> When sending a patch series, the emails often arrive at the final
> destination out of order; though these emails should be chained
> via the In-Reply-To headers, some mail-viewing systems display
> by order of arrival instead.
>
> The --delay option provides a means for specifying that there
> should be a certain number of seconds of delay between sending
> emails, so that the arrival order can be controlled better.

If you are trying to force the order of messages that the client MUA
physically receives the messages, I do not think giving N second
interval at the sending end would help much in the real world.  Between
your submitting MUA (that's "git-send-email") and the client MUA, there
are many hops involved:

 * Your outgoing MSA (typically your ISP's sendmail) your MUA hands
   messages to;

 * Your ISP's internal mail routing chain of MTAs that forward the
   messages around;

 * The recipient's ISP's incoming MTA that receives the messages from
   your ISP's outgoing MTA;

 * The recipient's ISP's internal mail routing chain of MTAs that
   forward the messages around, until they reach...

 * ... the mailbox at recipient's ISP that stores the messages until the
   recipient picks them up;

 * And finally the recipient's MUA that reads from the mailbox.

Messages your MUA sends out can take different paths in the above chain
even though the final destination (mailbox at the recipient's ISP) may
be the same, and different mailpaths can and do have different
latencies.  Even if all the messages sent out by a single invocation of
your submitting MUA happened to take the same mailpath, any single hop
can batch the messages that arrive within a small time window before
passing them to the next hop, and it can reorder the messages when it
does so.

In short, the only thing your --delay can control is the arrival
interval at your outgoing MSA.  The arrival interval and order of
messages are outside your control for later hops.

On the other hand, I think send-email already has hacks to timestamp the
messages at least one-second apart by shifting the Date: field, so that
the recipient MUA can sort by the departure timestamp if it wants to (and
if it can), instead of the arrival timestamp.  Is it not working well for
you?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
@ 2009-04-08 14:25 Michael Witten
  2009-04-08 14:35 ` Michael Witten
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-08 14:25 UTC (permalink / raw)
  To: Jeff King, Nicolas Sebrecht, Junio C Hamano; +Cc: git

On Tue, Apr 07, 2009 at 04:25:17PM -0500, Michael Witten wrote:
>> When sending a patch series, the emails often arrive at the final
>> destination out of order; though these emails should be chained
>> via the In-Reply-To headers, some mail-viewing systems display
>> by order of arrival instead.
>>
>> The --delay option provides a means for specifying that there
>> should be a certain number of seconds of delay between sending
>> emails, so that the arrival order can be controlled better.

On Tue, Apr 7, 2009 at 16:51, Jeff King wrote:
> I'm a little dubious how well this works in practice. Have you done
> any experiments?

I have indeed, and I got better results. Whether that was a fluke,
I can't say for sure.

> [Delivery delays] can be much larger than a few seconds, and this
> won't help at all there.

and

On Tue, Apr 7, 2009 at 18:17, Junio C Hamano wrote:
> I do not think giving N second interval at the sending end would
> help much in the real world. Between your submitting MUA (that's
> "git-send-email") and the client MUA, there are many hops involved...
> any single hop can batch the messages that arrive within a small time
> window before passing them to the next hop, and it can reorder the
> messages when it does so.
>
> In short, the only thing your --delay can control is the arrival
> interval at your outgoing MSA. The arrival interval and order of
> messages are outside your control for later hops.

For the most part, yes, I am operating under the assumption that email
is sent as soon as it is received by any intervening hop (no batch
accumulation). However, I'm also postulating that there always exists
an N that serves as an upperbound on the transit time, regardless of
batching.

That's where these comment comes into play:

On Tue, Apr 7, 2009 at 16:51, Jeff King wrote:
> The reason I am dubious is that you are presumably delaying only a few
> seconds (since anything more would be quite annoying to the user).

On Wed, Apr 8, 2009 at 01:03:
> A multi-second delay is downright annoying. As a sender, I don't think
> I would enable this option.

However, this sentiment doesn't make sense to me.

Firstly, I presume that someone is electing to use this option, so it is
almost by definition not annoying for that person.

Secondly, it seems reasonable to drop into another VC, screen window, or
terminal instance, and then set send-email a-running. For instance, with
a 14-patch series, one could set `--delay 60' and then let send-email
run happily for the next 14 minutes with nary a thought.

However, I think you're coming at it from a different angle:

On Wed, Apr 8, 2009 at 01:03, Jeff King wrote:
> But apparently many readers sort by date received. See this subthread:
> 
>  http://article.gmane.org/gmane.comp.version-control.git/110097
> 
> I am generally of the opinion that if it is a big problem for people,
> they should get a better mail client. But I am also open to suggestions
> for helping receivers on crappy mail clients as long as those
> suggestions do not put a burden on the sender.

and

on Tue, Apr 7, 2009 at 17:08, Nicolas Sebrecht wrote:
> If the receiver wants the patch series be in a good ordered _for
> sure_, he has to switch to a client mail supporting the In-Reply-To
> chains.

Frankly, I don't care how other people's patch series appear to me. I care
about how mine appear to others. Is this irrational? Probably, but I'm kind
of OC; I want my patch series to look like it's in order for everyone.

This has nothing to do with what the receiver wants. This has everything
to do with what the sender wants. I want my patch series to be in order
even for wrongheaded receivers.

So, I never had any intention of forcing a delay on the sending end. It is
strictly for the sending end to use if desired.

On Tue, Apr 7, 2009 at 18:17, Junio C Hamano wrote:
> I think send-email already has hacks to timestamp the messages at
> least one-second apart by shifting the Date: field, so that the
> recipient MUA can sort by the departure timestamp if it wants to (and
> if it can), instead of the arrival timestamp. Is it not working well
> for you?

I have worked with 2 major mail clients that both display by date received:

  * Mac OS X's Mail
  * Gmail

I assume that a not-insignificant number of others also use these clients.
I don't mind letting send-email run in the background for a few minutes if
it means my patch series appear in order.

As you say, Jeff:

> On Wed, Apr 08, 2009 at 12:08:54AM +0200, Nicolas Sebrecht wrote:
>> IMHO, this improvement is broken by design. We try to fix a
>> receiver-only issue by a sender side fix.
> 
> I almost said the same thing: it is really the receiver's problem.
> However, that doesn't mean the sender can't do simple things to help
> hint the right thing to the receiver. For example, we already munge the
> date fields to make sure the timestamp in each patch is increasing.

There's nothing simpler than slowing the rate of outgoing email. It doesn't
even have to be used; it is completely unintrusive and fully automated. It
even works with the confirmation. Best of all, it didn't take much code to
implement.

Sincerely,
Michael Witten

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-08 14:25 [PATCH RFC 1/6] send-email: Add --delay for separating emails Michael Witten
@ 2009-04-08 14:35 ` Michael Witten
  2009-04-09  8:14 ` Jeff King
  2009-04-09 16:17 ` [PATCH RFC 1/6] " Nicolas Sebrecht
  2 siblings, 0 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-08 14:35 UTC (permalink / raw)
  To: Jeff King, Nicolas Sebrecht, Junio C Hamano; +Cc: git

On Wed, Apr 8, 2009 at 09:25, Michael Witten <mfwitten@gmail.com> wrote:
> For instance, with
> a 14-patch series, one could set `--delay 60' and then let send-email
> run happily for the next 14 minutes with nary a thought.

As implemented, it would only take 13 minutes.

For a 5-patch series:

* Patch 1/5 sent
* delay 60 seconds
* Patch 2/5 sent
* delay 60 seconds
* Patch 3/5 sent
* delay 60 seconds
* Patch 4/5 sent
* delay 60 seconds
* Patch 5/5 sent
* send email exits immediately

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-08 14:25 [PATCH RFC 1/6] send-email: Add --delay for separating emails Michael Witten
  2009-04-08 14:35 ` Michael Witten
@ 2009-04-09  8:14 ` Jeff King
  2009-04-09  8:49   ` Junio C Hamano
  2009-04-09 17:48   ` Nicolas Pitre
  2009-04-09 16:17 ` [PATCH RFC 1/6] " Nicolas Sebrecht
  2 siblings, 2 replies; 18+ messages in thread
From: Jeff King @ 2009-04-09  8:14 UTC (permalink / raw)
  To: Michael Witten; +Cc: Nicolas Sebrecht, Junio C Hamano, git

On Wed, Apr 08, 2009 at 09:25:25AM -0500, Michael Witten wrote:

> Firstly, I presume that someone is electing to use this option, so it is
> almost by definition not annoying for that person.

Sure, obviously only people who enable it will be affected. I was
thinking of it more in terms of group economics: how many people _will_
enable it, because they think the payoff outweighs the annoyance.

And perhaps you can argue that it has negligible group cost. The
code is small and not likely to introduce new bugs. So the only costs
are whatever any sender is willing to pay themselves. And in that sense,
if even one person uses it, it is a net win.

> Secondly, it seems reasonable to drop into another VC, screen window, or
> terminal instance, and then set send-email a-running. For instance, with
> a 14-patch series, one could set `--delay 60' and then let send-email
> run happily for the next 14 minutes with nary a thought.

Except for your 10-minute "no activity, so let's suspend to ram"
timeout. ;) But I think we can assume since the user is opting in to the
feature that they don't have a problem with it.

> Frankly, I don't care how other people's patch series appear to me. I care
> about how mine appear to others. Is this irrational? Probably, but I'm kind
> of OC; I want my patch series to look like it's in order for everyone.

No, it's not irrational. We spend time proofreading, cleaning up
patches, etc, because we know other people will read them. And a little
effort by the sender can often save a lot of effort by many readers. And
people do it out of politeness, perhaps, or altruism, or simply because
it encourages others to spend the effort for them.

But I would personally find such a delay annoying (especially 60
seconds, which I consider to be huge), and I feel that by threading and
using sane date fields, I have done enough for the reader.

> I have worked with 2 major mail clients that both display by date received:
> 
>   * Mac OS X's Mail
>   * Gmail

Somebody reported in the thread I referenced earlier that gmane's web
interface has the same problem; I didn't check it myself, though.

> There's nothing simpler than slowing the rate of outgoing email. It doesn't
> even have to be used; it is completely unintrusive and fully automated. It
> even works with the confirmation. Best of all, it didn't take much code to
> implement.

I disagree that it's unintrusive (and I understand that you don't think
it is, and that there may be others like you, but I am pointing out
there are others who think the opposite). But given that it's optional,
and it's not very much code, I don't have a strong objection. My
original comment was that I was dubious whether it would work: however,
I was thinking you would set it to a few seconds. Setting it to 60
seconds, I can imagine it would have an impact.

-Peff

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09  8:14 ` Jeff King
@ 2009-04-09  8:49   ` Junio C Hamano
  2009-04-09 17:51     ` Nicolas Pitre
  2009-04-09 17:48   ` Nicolas Pitre
  1 sibling, 1 reply; 18+ messages in thread
From: Junio C Hamano @ 2009-04-09  8:49 UTC (permalink / raw)
  To: Jeff King; +Cc: Michael Witten, Nicolas Sebrecht, git

Jeff King <peff@peff.net> writes:

> I disagree that it's unintrusive (and I understand that you don't think
> it is, and that there may be others like you, but I am pointing out
> there are others who think the opposite). But given that it's optional,
> and it's not very much code, I don't have a strong objection. My
> original comment was that I was dubious whether it would work: however,
> I was thinking you would set it to a few seconds. Setting it to 60
> seconds, I can imagine it would have an impact.

Heh, then why not make the option specify the number of _minutes_ not
seconds to delay?  That would help clarifying what this option is meant to
do.

The description for this new feature in the manual page should make it
absolutely clear that the maintainer who accepts such a feature is not
clueless to think that such a delay will guarantee something.  It is
merely for people who believe it would help guaranteeing the delivery
order _in practice_ and are willing to background the slow sending.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails
  2009-04-08 14:25 [PATCH RFC 1/6] send-email: Add --delay for separating emails Michael Witten
  2009-04-08 14:35 ` Michael Witten
  2009-04-09  8:14 ` Jeff King
@ 2009-04-09 16:17 ` Nicolas Sebrecht
  2009-04-09 17:27   ` Michael Witten
  2 siblings, 1 reply; 18+ messages in thread
From: Nicolas Sebrecht @ 2009-04-09 16:17 UTC (permalink / raw)
  To: Michael Witten; +Cc: Jeff King, Nicolas Sebrecht, Junio C Hamano, git

On Wed, Apr 08, 2009 at 09:25:25AM -0500, Michael Witten wrote:


> This has nothing to do with what the receiver wants. This has everything
> to do with what the sender wants. I want my patch series to be in order
> even for wrongheaded receivers.

The --delay option may have an undesirable side effect. In case of
non-chained emails, unrelated mails could be insterted between patches
where *all* MUA would be affected. It's not only true for very high
volume message mailing-lists (million monkeys receiving...). FMPOV, it's
worse than all display issues we already know or have with the current
behaviour. 

-- 
Nicolas Sebrecht

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails
  2009-04-09 16:17 ` [PATCH RFC 1/6] " Nicolas Sebrecht
@ 2009-04-09 17:27   ` Michael Witten
  2009-04-09 17:38     ` Michael Witten
  2009-04-09 17:45     ` Nicolas Sebrecht
  0 siblings, 2 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-09 17:27 UTC (permalink / raw)
  To: Nicolas Sebrecht; +Cc: git

On Thu, Apr 9, 2009 at 11:17, Nicolas Sebrecht
<nicolas.s-dev@laposte.net> wrote:
>
> The --delay option may have an undesirable side effect. In case of
> non-chained emails, unrelated mails could be insterted between patches
> where *all* MUA would be affected. It's not only true for very high
> volume message mailing-lists (million monkeys receiving...). FMPOV, it's
> worse than all display issues we already know or have with the current
> behaviour.

But it's already impossible to protect against this scenario. In that
situation, the smallest delay possible is desired, so --delay wouldn't
even be used (that is, its value would be zero). However, the transit
delay could never be small enough to guarantee that no other emails
are inserted into the patch series, so the only solution is to chain
them. At this point, we're back to the problem of arrival time, and
hence --delay becomes useful.

:-D

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails
  2009-04-09 17:27   ` Michael Witten
@ 2009-04-09 17:38     ` Michael Witten
  2009-04-09 17:45     ` Nicolas Sebrecht
  1 sibling, 0 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-09 17:38 UTC (permalink / raw)
  To: Nicolas Sebrecht; +Cc: git

On Thu, Apr 9, 2009 at 12:27, Michael Witten <mfwitten@gmail.com> wrote:
> On Thu, Apr 9, 2009 at 11:17, Nicolas Sebrecht
> <nicolas.s-dev@laposte.net> wrote:
>>
>> The --delay option may have an undesirable side effect. In case of
>> non-chained emails, unrelated mails could be insterted between patches
>> where *all* MUA would be affected. It's not only true for very high
>> volume message mailing-lists (million monkeys receiving...). FMPOV, it's
>> worse than all display issues we already know or have with the current
>> behaviour.
>
> But it's already impossible to protect against this scenario. In that
> situation, the smallest delay possible is desired, so --delay wouldn't
> even be used (that is, its value would be zero). However, the transit
> delay could never be small enough to guarantee that no other emails
> are inserted into the patch series, so the only solution is to chain
> them. At this point, we're back to the problem of arrival time, and
> hence --delay becomes useful.

I do agree that --delay could exacerbate the spreading out of patches.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails
  2009-04-09 17:27   ` Michael Witten
  2009-04-09 17:38     ` Michael Witten
@ 2009-04-09 17:45     ` Nicolas Sebrecht
  2009-04-09 18:43       ` Michael Witten
  1 sibling, 1 reply; 18+ messages in thread
From: Nicolas Sebrecht @ 2009-04-09 17:45 UTC (permalink / raw)
  To: Michael Witten; +Cc: Nicolas Sebrecht, git

On Thu, Apr 09, 2009 at 12:27:18PM -0500, Michael Witten wrote:
> 
> On Thu, Apr 9, 2009 at 11:17, Nicolas Sebrecht
> <nicolas.s-dev@laposte.net> wrote:
> >
> > The --delay option may have an undesirable side effect. In case of
> > non-chained emails, unrelated mails could be insterted between patches
> > where *all* MUA would be affected. It's not only true for very high
> > volume message mailing-lists (million monkeys receiving...). FMPOV, it's
> > worse than all display issues we already know or have with the current
> > behaviour.
> 
> But it's already impossible to protect against this scenario.

But we could forbid the use of --delay with non-chained emails, no? Or
at least, warn it should not be used.

-- 
Nicolas Sebrecht

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09  8:14 ` Jeff King
  2009-04-09  8:49   ` Junio C Hamano
@ 2009-04-09 17:48   ` Nicolas Pitre
  2009-04-09 19:28     ` Junio C Hamano
  1 sibling, 1 reply; 18+ messages in thread
From: Nicolas Pitre @ 2009-04-09 17:48 UTC (permalink / raw)
  To: Jeff King; +Cc: Michael Witten, Nicolas Sebrecht, Junio C Hamano, git

On Thu, 9 Apr 2009, Jeff King wrote:

> On Wed, Apr 08, 2009 at 09:25:25AM -0500, Michael Witten wrote:
> 
> > Firstly, I presume that someone is electing to use this option, so it is
> > almost by definition not annoying for that person.
> 
> Sure, obviously only people who enable it will be affected. I was
> thinking of it more in terms of group economics: how many people _will_
> enable it, because they think the payoff outweighs the annoyance.

My ISP doesn't allow me to send more than 20 emails at once.  So if a 
patch series has more than 20 patches, send-email will be denied the 
sending of the end of the series, which is rather anoying.

I didn't test this option (have no large patch series to post at the 
moment), but if it could allow me to easily work around the ISP 
restriction then I would be happy.


Nicolas

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09  8:49   ` Junio C Hamano
@ 2009-04-09 17:51     ` Nicolas Pitre
  0 siblings, 0 replies; 18+ messages in thread
From: Nicolas Pitre @ 2009-04-09 17:51 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, Michael Witten, Nicolas Sebrecht, git

On Thu, 9 Apr 2009, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > I disagree that it's unintrusive (and I understand that you don't think
> > it is, and that there may be others like you, but I am pointing out
> > there are others who think the opposite). But given that it's optional,
> > and it's not very much code, I don't have a strong objection. My
> > original comment was that I was dubious whether it would work: however,
> > I was thinking you would set it to a few seconds. Setting it to 60
> > seconds, I can imagine it would have an impact.
> 
> Heh, then why not make the option specify the number of _minutes_ not
> seconds to delay?  That would help clarifying what this option is meant to
> do.

Maybe only a few seconds is all that is needed in some circumstances.
For the issue I just posted, I wouldn't use it at all if the minimum 
delay was one minute.


Nicolas

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails
  2009-04-09 17:45     ` Nicolas Sebrecht
@ 2009-04-09 18:43       ` Michael Witten
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-09 18:43 UTC (permalink / raw)
  To: Nicolas Sebrecht; +Cc: git

On Thu, Apr 9, 2009 at 12:45, Nicolas Sebrecht
<nicolas.s-dev@laposte.net> wrote:
> But we could forbid the use of --delay with non-chained emails, no? Or
> at least, warn it should not be used.

Ah! Good point! I'll add that.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09 17:48   ` Nicolas Pitre
@ 2009-04-09 19:28     ` Junio C Hamano
  2009-04-09 19:36       ` Nicolas Pitre
  2009-04-09 20:59       ` Michael Witten
  0 siblings, 2 replies; 18+ messages in thread
From: Junio C Hamano @ 2009-04-09 19:28 UTC (permalink / raw)
  To: Nicolas Pitre; +Cc: Jeff King, Michael Witten, Nicolas Sebrecht, git

Nicolas Pitre <nico@cam.org> writes:

> On Thu, 9 Apr 2009, Jeff King wrote:
>
>> On Wed, Apr 08, 2009 at 09:25:25AM -0500, Michael Witten wrote:
>> 
>> > Firstly, I presume that someone is electing to use this option, so it is
>> > almost by definition not annoying for that person.
>> 
>> Sure, obviously only people who enable it will be affected. I was
>> thinking of it more in terms of group economics: how many people _will_
>> enable it, because they think the payoff outweighs the annoyance.
>
> My ISP doesn't allow me to send more than 20 emails at once.

Hmm, I first thought you meant 20 emails in a single smtp session, but it
appears that we create a new instance of Net::SMTP for each piece of email
so it really sounds like it is time based (N pieces of e-mail within M
minutes).

Perhaps --pause=N,M to say "Pause N seconds for every M messages", where
Michael's --delay=N is just a shorthand for --pause=N,1 is what you want?
That is, reset the counter to 0 at the beginning, increment it after
sending each message, and when the counter is M and if you have more to
send, you wait for N seconds and reset the counter to 0.  Then when you
have a series smaller than 20 you won't have to suffer from any artificial
delay.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09 19:28     ` Junio C Hamano
@ 2009-04-09 19:36       ` Nicolas Pitre
  2009-04-09 20:59       ` Michael Witten
  1 sibling, 0 replies; 18+ messages in thread
From: Nicolas Pitre @ 2009-04-09 19:36 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Jeff King, Michael Witten, Nicolas Sebrecht, git

On Thu, 9 Apr 2009, Junio C Hamano wrote:

> Nicolas Pitre <nico@cam.org> writes:
> 
> > On Thu, 9 Apr 2009, Jeff King wrote:
> >
> >> On Wed, Apr 08, 2009 at 09:25:25AM -0500, Michael Witten wrote:
> >> 
> >> > Firstly, I presume that someone is electing to use this option, so it is
> >> > almost by definition not annoying for that person.
> >> 
> >> Sure, obviously only people who enable it will be affected. I was
> >> thinking of it more in terms of group economics: how many people _will_
> >> enable it, because they think the payoff outweighs the annoyance.
> >
> > My ISP doesn't allow me to send more than 20 emails at once.
> 
> Hmm, I first thought you meant 20 emails in a single smtp session, but it
> appears that we create a new instance of Net::SMTP for each piece of email
> so it really sounds like it is time based (N pieces of e-mail within M
> minutes).
> 
> Perhaps --pause=N,M to say "Pause N seconds for every M messages", where
> Michael's --delay=N is just a shorthand for --pause=N,1 is what you want?
> That is, reset the counter to 0 at the beginning, increment it after
> sending each message, and when the counter is M and if you have more to
> send, you wait for N seconds and reset the counter to 0.  Then when you
> have a series smaller than 20 you won't have to suffer from any artificial
> delay.

I suppose that would work fine too.


Nicolas

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09 19:28     ` Junio C Hamano
  2009-04-09 19:36       ` Nicolas Pitre
@ 2009-04-09 20:59       ` Michael Witten
  2009-04-09 21:02         ` Michael Witten
  1 sibling, 1 reply; 18+ messages in thread
From: Michael Witten @ 2009-04-09 20:59 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

>> My ISP doesn't allow me to send more than 20 emails at once.
>
> Hmm, I first thought you meant 20 emails in a single smtp session, but it
> appears that we create a new instance of Net::SMTP for each piece of email
> so it really sounds like it is time based (N pieces of e-mail within M
> minutes).

Actually, there is a lot of ||= going on in there, so it would seem
that only one
smtp session is created; the weird thing is that STARTTLS and $smtp->hello() are
run each time through send_message(), which I think is probably wrong.
If it works,
then I imagine it's just superfluous.

In any case, if his ISP doesn't like him sending more than 20 emails
per session,
then it certainly won't like 1 session per email.

> Perhaps --pause=N,M to say "Pause N seconds for every M messages", where
> Michael's --delay=N is just a shorthand for --pause=N,1 is what you want?
> That is, reset the counter to 0 at the beginning, increment it after
> sending each message, and when the counter is M and if you have more to
> send, you wait for N seconds and reset the counter to 0.  Then when you
> have a series smaller than 20 you won't have to suffer from any artificial
> delay.

This sounds reasonable, but I would have:

    --rate=M/N

Michael Witten

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails
  2009-04-09 20:59       ` Michael Witten
@ 2009-04-09 21:02         ` Michael Witten
  0 siblings, 0 replies; 18+ messages in thread
From: Michael Witten @ 2009-04-09 21:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Thu, Apr 9, 2009 at 15:59, Michael Witten <mfwitten@gmail.com> wrote:
>> Perhaps --pause=N,M to say "Pause N seconds for every M messages", where
>> Michael's --delay=N is just a shorthand for --pause=N,1 is what you want?
>> That is, reset the counter to 0 at the beginning, increment it after
>> sending each message, and when the counter is M and if you have more to
>> send, you wait for N seconds and reset the counter to 0.  Then when you
>> have a series smaller than 20 you won't have to suffer from any artificial
>> delay.
>
> This sounds reasonable, but I would have:
>
>    --rate=M/N

I take that back. Clearly `rate' connotes an average rather than a burst.

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2009-04-09 21:04 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-08 14:25 [PATCH RFC 1/6] send-email: Add --delay for separating emails Michael Witten
2009-04-08 14:35 ` Michael Witten
2009-04-09  8:14 ` Jeff King
2009-04-09  8:49   ` Junio C Hamano
2009-04-09 17:51     ` Nicolas Pitre
2009-04-09 17:48   ` Nicolas Pitre
2009-04-09 19:28     ` Junio C Hamano
2009-04-09 19:36       ` Nicolas Pitre
2009-04-09 20:59       ` Michael Witten
2009-04-09 21:02         ` Michael Witten
2009-04-09 16:17 ` [PATCH RFC 1/6] " Nicolas Sebrecht
2009-04-09 17:27   ` Michael Witten
2009-04-09 17:38     ` Michael Witten
2009-04-09 17:45     ` Nicolas Sebrecht
2009-04-09 18:43       ` Michael Witten
  -- strict thread matches above, loose matches on Subject: below --
2009-04-07 21:25 [PATCH RFC 1/6] " Michael Witten
2009-04-07 21:51 ` Jeff King
2009-04-07 23:17 ` Junio C Hamano

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 NNTP newsgroup(s).