All,
I'm getting a strange disconnect on long running functions (approx 15 seconds):
onLeave: CloseDetails(reason = wamp.close.transport_lost, message = 'WAMP transport was lost without closing the session before'')
I'm running my python in 3.5 but I was getting the same behavior in python 3.4.0 as well, here is traceback:
File "/usr/local/lib/python3.5/site-packages/txaio/aio.py", line 329, in done
x = callback(res)
File "/usr/local/lib/python3.5/site-packages/autobahn/wamp/protocol.py", line 796, in success
'NoneType' object has no attribute 'send'
self._transport.send(reply)
AttributeError: 'NoneType' object has no attribute 'send'
Exception in callback add_callbacks.<locals>.done(<Task finishe...sh.log.tar"]'>) at /usr/local/lib/python3.5/site-packages/txaio/aio.py:325
handle: <Handle add_callbacks.<locals>.done(<Task finishe...sh.log.tar"]'>) at /usr/local/lib/python3.5/site-packages/txaio/aio.py:325>
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/txaio/aio.py", line 329, in done
x = callback(res)
File "/usr/local/lib/python3.5/site-packages/autobahn/wamp/protocol.py", line 796, in success
self._transport.send(reply)
AttributeError: 'NoneType' object has no attribute 'send'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/python/Python-3.5.0/Lib/asyncio/events.py", line 125, in _run
self._callback(*self._args)
File "/usr/local/lib/python3.5/site-packages/txaio/aio.py", line 334, in done
errback(create_failure())
File "/usr/local/lib/python3.5/site-packages/autobahn/wamp/protocol.py", line 818, in error
del self._invocations[msg.request]
KeyError: 192
I AM running async coroutines recursively like this (simplified):
@asyncio.coroutine
def recurse_tar(self, tar, passed_path=""):
try:
for member in tar.getmembers():
ext = [".tar", ".tgz", ".tar.gz"]
if member.name.endswith(tuple(ext)):
z = None
f = None
try:
print(full_path)
self.search_result.append(full_path)
z = tar.extractfile(member)
if not z:
print(Fore.ORANGE + z + " is NONE!" + Fore.RESET)
f = tarfile.open(fileobj=z)
if not f:
print(Fore.ORANGE + f + " is NONE!" + Fore.RESET)
yield from asyncio.ensure_future(self.recurse_tar(f, full_path))
except Exception as e:
finally:
f.close()
z.close()
self.counter += 1
else:
pass # TODO: Logic for file processing
except Exception as e:
print(Fore.RED + str(e) + Fore.RESET)
finally:
if tar:
tar.close()
@asyncio.coroutine
def parse(file_full_path)
tasks = []
for ...
tasks.append(asyncio.ensure_future(self.recurse_tar(tarfile.open(file_full_path))))
yield from asyncio.wait(tasks)
A couple of questions:
What are the conditions that cause a WAMP transport to close with the above error?
Is there a time limit or quota for WAMP transports?
Am I going down the wrong troubleshooting path entirely?
Any help appreciated....
Dave