Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #10847

Re: Inconsistent SMTP/Gmail connection drop

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <astley.lejasper@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'suppose': 0.05; 'pypy': 0.07; 'suggestions.': 0.07; 'through,': 0.07; 'python': 0.08; ';-)': 0.12; 'failed.': 0.16; 'jython': 0.16; 'pause': 0.16; 'subject:drop': 0.16; 'terminates': 0.16; 'worked.': 0.16; 'tries': 0.16; 'cc:addr:python-list': 0.16; '2.x': 0.19; 'happening': 0.19; 'seems': 0.20; 'seconds': 0.21; 'cc:2**0': 0.21; 'loop': 0.22; 'cc:no real name:2**0': 0.22; 'so.': 0.22; 'header:In-Reply-To:1': 0.22; 'assume': 0.23; 'locking': 0.23; 'code': 0.24; 'received:209.85.220': 0.25; 'tests': 0.25; 'tried': 0.27; 'seeing': 0.28; 'version,': 0.28; 'message- id:@mail.gmail.com': 0.28; 'script': 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.30; '3.x': 0.30; 'recipients.': 0.30; 'looks': 0.30; 'thanks': 0.31; 'collecting': 0.31; 'lines': 0.31; 'error': 0.31; 'coding': 0.32; 'list': 0.32; 'file.': 0.32; "i'll": 0.33; 'actually': 0.33; "i've": 0.33; '...': 0.34; 'google': 0.34; 'test': 0.34; 'identical': 0.35; 'running': 0.35; 'subject:/': 0.36; 'connection': 0.36; 'file': 0.36; 'bigger': 0.37; 'but': 0.37; 'could': 0.37; 'received:google.com': 0.38; 'not,': 0.38; 'received:209.85': 0.38; 'url:org': 0.38; 'subject:: ': 0.38; '8bit%:8': 0.38; 'too,': 0.38; 'something': 0.38; 'think': 0.38; 'put': 0.38; 'perhaps': 0.39; 'case': 0.39; 'should': 0.39; 'data': 0.39; 'got': 0.39; 'goes': 0.39; "there's": 0.39; 'under': 0.39; 'might': 0.39; 'received:209': 0.40; 'where': 0.40; 'your': 0.60; 'happen': 0.62; 'maximum': 0.62; 'order': 0.62; 'emails': 0.63; 'full': 0.63; 'making': 0.66; 'recipients': 0.68; 'tiny': 0.68; 'ideas.': 0.73; 'yourself,': 0.74; 'night': 0.77; 'disconnects': 0.84; 'subject:Gmail': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=RG1zVc1dzTszO4qXhBM10COy9p+qouzMISoBJTHv7cw=; b=UDE+Mhm2IMTef1cha8a+D60pOx0jgESlIVXnj9t4VNWGlrmjj7d5wL2ioDOViUQTKL ovmaSznCENuhk3FrNv7LZKFbqPaNis2wH+zW3cyq8//axutOpJWjrqC+IjltOsOvaDY/ XPHOEUT553iH8MuswLIu7U9LuS037EV5OZHro=
MIME-Version 1.0
In-Reply-To <CAGGBd_p2vEBJoOyA+6OJ2A3f3ShCbseKyVL2em2U6cky0kGPVg@mail.gmail.com>
References <92b389cf-4aa9-4cc3-9017-d4b1ec6de7d8@d7g2000vbv.googlegroups.com> <CAGGBd_p2vEBJoOyA+6OJ2A3f3ShCbseKyVL2em2U6cky0kGPVg@mail.gmail.com>
Date Thu, 4 Aug 2011 09:54:26 +0200
Subject Re: Inconsistent SMTP/Gmail connection drop
From Astley Le Jasper <astley.lejasper@gmail.com>
To Dan Stromberg <drsalists@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1882.1312444470.1164.python-list@python.org> (permalink)
Lines 59
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1312444470 news.xs4all.nl 23940 [2001:888:2000:d::a6]:40984
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:10847

Show key headers only | View raw


Thanks for those suggestions.

I tried something last night before I got your ideas.

1. I added a line to send a copy of the report just to me, 2 lines
before the line where it emails the report to all the recipients.
2. I also added a timer.sleep(5) pause just before the line that
emails the reports to all the recipients.

So the order was:

a) Send the full report just to me .... FAILED.
b) Pause for 5 seconds.
c) Send the full report to all 4 recipients ... WORKED.
d) Send the log file just to me ... WORKED.

So ... what looks like may be happening is that something might still
be locking the file. In which case i'll try again without the test
email to me. And/or perhaps send a test email without the attachment
before the main report to see if that gets through, to see if the
connection with gmail is actually really connected.

See also below...

> 1) You might see if there's something about the size of the message - is it
> bigger after collecting data all night?  Is google disconnecting after a
> maximum amount of data is transferred?

I don't think so. The test message I mentioned above got through and
the attachment was identical (320kb or abouts)

> 2) You might try sending a tiny test message at the beginning, just to
> yourself, and seeing if that has the problem

As above.

> 3) You might try running your script under a system call tracer:
> http://stromberg.dnsalias.org/~dstromberg/debugging-with-syscall-tracers.html
> - and inspecting the list of syscalls and their return codes near when the
> process terminates

Ouch. Looks complicated!
;-)

> 4) I get disconnects from gmail once in a while too, especially when
> downloading a large list of new message headers; I've been just coding
> around it by making my code idempotent and otherwise restartable.  This
> seems to happen with both 2.x and 3.x, so I assume it's not really related
> to the Python version, but I suppose I should try it on PyPy or Jython
> someday.  Note that the error message in 3.x was better than in 2.x.

I was thinking that perhaps I could put a loop in that tests if the
email goes through, and if not, pauses for a few seconds and then
tries again.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Inconsistent SMTP/Gmail connection drop Astley Le Jasper <astley.lejasper@gmail.com> - 2011-08-03 14:46 -0700
  Re: Inconsistent SMTP/Gmail connection drop Astley Le Jasper <astley.lejasper@gmail.com> - 2011-08-04 00:26 +0200
  Re: Inconsistent SMTP/Gmail connection drop Astley Le Jasper <astley.lejasper@gmail.com> - 2011-08-04 09:54 +0200
  Re: Inconsistent SMTP/Gmail connection drop Astley Le Jasper <astley.lejasper@gmail.com> - 2011-08-04 11:24 +0200

csiph-web