alonho / pystuck Goto Github PK
View Code? Open in Web Editor NEWa utility for debugging stuck python programs
License: BSD 4-Clause "Original" or "Old" License
a utility for debugging stuck python programs
License: BSD 4-Clause "Original" or "Old" License
Basically, if you have a multithreaded application (using real threads, e.g. the multiprocessing
module), they all try to open the same port, and you get crashes.
Basically, it seems pystuck assumes it's installed into only one process. This is /probably/ not really something that can be fixed easily, given the current system architecture, but it's a good thing to note clearly in the documentation, if anything.
monkey patching only works if pystuck is imported first and pystuck.greenlets.patch() is called
rpyc 3.3 doesn't contain the unix_connect function and thus the import fails.
In #7, the --unix_socket
feature recently added was removed, as it generated an import error from rpyc
.
It was suspected that rpyc
had removed the API, however it was actually not-yet-released, so in master
only. At the time, pystuck
was marked to require rpyc == 3.2.3
but following 760b3d8 it actually required a master build of rpyc
with the addition of unix_connect
support in rpyc
via tomerfiliba-org/rpyc@2b7eb0c .
This feature was not released until much later via rpyc
3.4.4: tomerfiliba-org/rpyc@d71443f .
Testing with current rpyc
shows unix_socket
should work, so I propose to restore this feature.
https://github.com/alonho/pystuck/blob/master/pystuck/__init__.py#L31
The arg parser does not convert this to a port int value, you need to add type=int
to the above.
pystuck --port=5406
Traceback (most recent call last):
File "/usr/local/bin/pystuck", line 8, in <module>
load_entry_point('pystuck==0.4', 'console_scripts', 'pystuck')()
File "build/bdist.linux-x86_64/egg/pystuck/__init__.py", line 39, in main
File "build/bdist.linux-x86_64/egg/pystuck/__init__.py", line 17, in run_client
File "/usr/local/lib/python2.7/site-packages/rpyc-3.2.3-py2.7.egg/rpyc/utils/classic.py", line 65, in connect
return factory.connect(host, port, SlaveService, ipv6 = ipv6)
File "/usr/local/lib/python2.7/site-packages/rpyc-3.2.3-py2.7.egg/rpyc/utils/factory.py", line 89, in connect
s = SocketStream.connect(host, port, ipv6 = ipv6)
File "/usr/local/lib/python2.7/site-packages/rpyc-3.2.3-py2.7.egg/rpyc/core/stream.py", line 114, in connect
return cls(cls._connect(host, port, **kwargs))
File "/usr/local/lib/python2.7/site-packages/rpyc-3.2.3-py2.7.egg/rpyc/core/stream.py", line 92, in _connect
s.connect((host, port))
File "/usr/local/lib/python2.7/socket.py", line 222, in meth
return getattr(self._sock,name)(*args)
TypeError: an integer is required
So all the Ipython
prompt stuff will break on 5.0 since they reworked the API and started using prompt-toolkit.
It might actually be worth it to write a custom prompt toolkit shell app that's more specific to this project's needs?
For right now we need to limit to ipython<5.0
.
I love the simplicity of using this debug stuff like multiprocessing
issues or weird sync with pytorch
DDP shindiggery.
However, this doesn't have an explicit license :(
I see its listing on PyPI indicates it's BSD:
https://pypi.org/project/pystuck/
Will submit PR that updates, if you have time!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.