Open ellieayla opened 9 years ago
I made that change locally and left a session up for 3 days doing this; no problems experienced.
while True:
time.sleep(120)
print svc.describeTabs()[0]['label']
Sorry about my negligence, I was afk for the past 2 months. I will address these prs in the following week.
There are significant problems with the way the initial connection is set up. This is definitely one of them. If you submit a pull request with a proposed alternative, there is lots of room for improvement.
The function
xmlclient.py
:SoapEnvelope
.post()
is called withconn
as an instance of ahttplib.HTTPSConnection
produced bymakeConnection()
.The "conn" variable is, however, sometimes recreated inside here with
conn = makeConnection(scheme, host)
. This doesn't make much sense for recovery, since it will never be propagated back up to the caller's__conn
. The only valid use-case is when the caller didn't pass a connection (which does happen inClient.login()
untilClient.useSession()
is called immediately after.But if an exception is thrown, this sets
conn=None
and then makes a new localconn
on the next pass.I think this reconnect loop was born of frustration without thinking things through.
It probably makes more sense to never set
conn = None
, and just do aconn.close()
. The next iteration'sconn.request()
will cause a new open, if required, sinceconn.auto_open=True
.