Python3 + tornado + pysftp causing exception and deadlock (bugs with asyncio module)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 2.1k
- PR merge metrics
- No merged PRs in 30d
Description
When running pysftp module through a tornado webserver the pysftp deadlocks on Python 3 with mysterious error messages that don't tell you what is going on. It was found after investigating the issue that it was possible to subclass Paramiko Transport class and use the following override on the run method to solve the issue
class myclass(paramiko.Transport):
def run(self):
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
paramiko.Transport.run(self)
To protect people from asyncio issues it is probably a good idea to create a new_event_loop by default. It might be possible to catch the exception and add an additional parameter to Paramiko to make it easy to fix asyncio issues with Paramiko and turn on/off event loop creation.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Paramiko's Transport.run method and reproduce the Python 3 failure in the reported tornado and pysftp setup. Compare the existing behavior with the proposed asyncio event-loop initialization and verify that the exception and deadlock are resolved without obscuring other failures.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100