Re: [Twisted-Python] Problem with osx10.10-py2.7 builder

2018-03-26 Thread Jean-Paul Calderone
On Mon, Mar 26, 2018 at 2:58 AM, Glyph  wrote:

> Alternately...
>
> The reason we're doing this at all is that Travis's macOS situation was
> pretty dismal when we last tried it.  But then, the graphs on
> https://www.traviscistatus.com at the time matched that experience:
> routinely there were build queues in the hundreds.  Right now the "Backlog
> macOS Builds for Open Source Projects" shows a completely flat line, zero
> for the last 24 hours.
>
> It might be worth trying out Travis again.
>

FWIW, I moved another project's macOS CI from Travis to CircleCI about a
month ago because the Travis macOS job queue was so long.  Counting queue
time, CircleCI finishes those jobs around 6x faster than TravisCI.

Maybe things have improved on Travis but they're still pretty bad.

Jean-Paul
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Asynchronous code in a context manager

2018-03-26 Thread Peter Westlake
Sadly, no. Should have said, sorry: it's 2.7.3.

Peter.

On Fri, 23 Mar 2018, at 17:54, meejah wrote:
> 
> Are you using Python3? Then there's "asynchronous context managers". I
> finally found a use-case for one in txtorcon, so here's an example:
> 
>
> http://txtorcon.readthedocs.io/en/latest/txtorcon-controller.html#txtorcon.Tor.onion_authentication
> 
> -- 
> meejah
> 
> ___
> Twisted-Python mailing list
> Twisted-Python@twistedmatrix.com
> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Strategy for finding source of unhandled error in Deferred

2018-03-26 Thread Barry Scott
On Sunday, 18 March 2018 15:23:58 BST Jean-Paul Calderone wrote:
> On Sun, Mar 18, 2018 at 11:21 AM, Jean-Paul Calderone <
> 
> exar...@twistedmatrix.com> wrote:
> > On Sun, Mar 18, 2018 at 11:04 AM, Alex Railean  wrote:
> >> Hello,
> >> 
> >> I have inherited a misbehaving system and am trying to troubleshoot it.
> >> The code
> >> is not documented and I cannot produce a minimal working example that
> >> illustrates
> >> the problem yet, as I don't know which parts are involved and how they
> >> relate.
> > 
> > This produces the following entries in the log:
> >> Unhandled error in Deferred:
> >> CRITICAL _legacy   twcore Unhandled error in Deferred:
> >> 
> >> Traceback (most recent call last):
> >> Failure: __builtin__.type: 
> >> CRITICAL _legacy   twcore
> >> 
> >> 
> >> 
> >> How can I get more clues about what is going on? I was expecting a line
> >> number,
> >> or a complete call-stack.
> 
> Try this:
> 
> from twisted.internet.defer import setDebugging
> setDebugging(True)
> 
> This gives you creation and callback stacks in the logs.

If you need to track down who put the value into the deferred
you need to patch the defer.py code to log that info.

There are 2 places that a value enters the Deferred.
The first is the callback() call. The other is in

defer.py:653 Deffered._runCallbacks()

653:current.result = callback(current.result, *args, 
**kw)

Barry


> 
> Jean-Paul
> 
> >> What are the recommended troubleshooting steps for finding the Deferred
> >> in which
> >> the error occurred?  There are are around 30 of them throughout the code,
> >> is
> >> there a heuristic I can use to narrow down the list of suspects?
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> ___
> >> Twisted-Python mailing list
> >> Twisted-Python@twistedmatrix.com
> >> https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python




___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Strategy for finding source of unhandled error in Deferred

2018-03-26 Thread Jean-Paul Calderone
On Mon, Mar 26, 2018 at 10:47 AM, Barry Scott 
wrote:

> On Sunday, 18 March 2018 15:23:58 BST Jean-Paul Calderone wrote:
> >
> > Try this:
> >
> > from twisted.internet.defer import setDebugging
> > setDebugging(True)
> >
> > This gives you creation and callback stacks in the logs.
>
> If you need to track down who put the value into the deferred
> you need to patch the defer.py code to log that info.
>
> There are 2 places that a value enters the Deferred.
> The first is the callback() call. The other is in
>
> defer.py:653 Deffered._runCallbacks()
>
> 653:current.result = callback(current.result,
> *args,
> **kw)
>

No, you don't:

exarkun@baryon:/tmp$ cat deferreddebug.py
from twisted.internet.defer import fail, setDebugging
setDebugging(True)
def foo():
return fail(Exception("boo"))
foo()
exarkun@baryon:/tmp$ python deferreddebug.py
Unhandled error in Deferred:
(debug:  C: Deferred was created:
 C:  File "deferreddebug.py", line 5, in 
 C:foo()
 C:  File "deferreddebug.py", line 4, in foo
 C:return fail(Exception("boo"))
 C:  File
"/home/exarkun/.local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 106, in fail
 C:d = Deferred()
 I: First Invoker was:
 I:  File "deferreddebug.py", line 5, in 
 I:foo()
 I:  File "deferreddebug.py", line 4, in foo
 I:return fail(Exception("boo"))
 I:  File
"/home/exarkun/.local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 107, in fail
 I:d.errback(result)
)
exarkun@baryon:/tmp$


Although it is true that you only get this behavior for the "Unhandled
error in Deferred" case.  If you explicitly log a Failure from a Deferred,
even with Deferred debugging on, you will not get a callstack for the
creator or invoker.  You'll just get whatever callstack the Failure has
(and the Failure is independent of the Deferred).

Jean-Paul
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Anonymous ESMTP Server

2018-03-26 Thread Khanorkar, Veeresh
All,

In order to accomdate a very old system, I need to write anonymous esmtp
server.

Is a sample code available somewhere?
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Problem with osx10.10-py2.7 builder

2018-03-26 Thread Glyph


> On Mar 26, 2018, at 3:32 AM, Jean-Paul Calderone  
> wrote:
> 
> On Mon, Mar 26, 2018 at 2:58 AM, Glyph  > wrote:
> Alternately...
> 
> The reason we're doing this at all is that Travis's macOS situation was 
> pretty dismal when we last tried it.  But then, the graphs on 
> https://www.traviscistatus.com  at the time 
> matched that experience: routinely there were build queues in the hundreds.  
> Right now the "Backlog macOS Builds for Open Source Projects" shows a 
> completely flat line, zero for the last 24 hours.
> 
> It might be worth trying out Travis again.
> 
> FWIW, I moved another project's macOS CI from Travis to CircleCI about a 
> month ago because the Travis macOS job queue was so long.  Counting queue 
> time, CircleCI finishes those jobs around 6x faster than TravisCI.
> 
> Maybe things have improved on Travis but they're still pretty bad.

That's a bummer, but thanks for providing the data point.

-g

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
https://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python