-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various problems on Windows #35
Comments
Hi @TTimo , Thanks for the reports. Windows is supported and generally has the same functionality as the Unix versions, but I don't have a Windows system available to test on, so sometimes Unix-isms creep in. In general, I know that within the last 2 years there was a lot of Windows use, so any issues should be within that timeframe. Running the tests using Python's unittest is not really supported: you should use pytest (https://docs.pytest.org) to run them, which will ensure the testing environment is setup correctly. Please let me know if the errors you are getting running the tests still occur when running via pytest and if so I'm definitely interested in resolving those issues. With regards to the failure to run the Act1 example, one of the common problems on Windows is that it defaults to a rather aggressive firewall configuration which can block network activity even on the local machine. You might want to check your network settings to disable this. You can also check the C:\Windows\temp\ directory to see if thespian has left a logfile there; if so you could supply that via gist or email and I can see if it will help diagnose what is going wrong. |
Hello @kquick - thanks for the prompt reply. Maybe let's just start with Python 2.7 and try to get that working then. I tried to use
Now back to I did the same to Using the default
The TCP example writes the following to the log file (not sure if relevant, including for completeness):
I turned the firewall off to make sure, but the previous error happens the same for
Maybe something is written to the log but not being flushed to disk, I cannot initiate a clean shutdown due to this error, so I can't obtain it.. |
The For the
And also modify thespian/system/multiprocTCPBase.py to add an It looks like the multiprocTCPBase is running fine, which is good. The multiprocUDPBase uses port 1029 by default, so there are likely two things going on since you've ruled out the firewall: (1) there is an old Actor system manager process running on port 1900 that is not working and should be killed so that a new one can be started, or (2) there is some other service running on port 1029 that is blocking Thespian from using it. The easiest way to fix this is to use an alternative port. This is done by providing a dictionary as the optional second argument to the asys = ActorSystem((sys.argv + ['multiprocTCPBase'])[1]) to add the capabilities argument: asys = ActorSystem((sys.argv + ['multiprocTCPBase'])[1], { 'Admin Port': 12345}) where you can use any port number > 1024 that you'd like and which isn't already in use in place of 12345. Thanks for your patience and help in looking into these Windows issues, and let me know if they work so that I can make them permanently. |
I sent #36 to fix the tests setup. I will re-run them to capture the full output, but there were quite a number of failures: Port 1900 is indeed used on Windows - by https://en.wikipedia.org/wiki/Simple_Service_Discovery_Protocol I made the changes to bind to port 12345, unfortunately I still get the same error for the UDP multiproc.
|
Thanks for the PR! The That's also good to know about port 1900; I'll change that default in an upcoming release. To help diagnose the app.py problem, there is some internal logging that Thespian performs (i.e. it does not use the logging library). This is driven from the |
I applied the change to I've reproduced the
And the log:
|
Hi @TTimo , Please try editing thespian/system/transport/UDPTransport.py line 166 to change the value from a 1 to a 0 so that the line reads: ss.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 0) I did some local testing and think this will fix the UDP issue, but I'd like to get confirmation from your setup. Thanks, |
Hey @kquick - that seems to have fixed it. I can start/stop UDP multiproc now. |
Excellent!! Thanks again for your patience and help with this. I'll get these changes committed and your PR merged today or tomorrow and put out a bugfix release. |
That sounds good - although I guess it depends if you want to put more time into the Windows support. I am running pytest right now and it's still showing a lot of failures. And this is only with Python 2.7, early on it looked like 3.x was going to have it's own set of issues. |
I'm happy to hold off on a release until things are looking better on your end. Also as a note, these tests are pretty heavy-weight because they are primarily functional tests (as opposed to unit tests where lots of actual functionality is mocked out). These tests create lots of processes and sockets and try to ensure that the right things happen in degenerate corner cases. As a result, they may be affected by resource constraints on your system and you may need to clean up a few processes that escaped the test cleanup. In particular, the tests usually pick a port number for each test, but if that port is already in use for something else that will trigger a collision and a test failure. I've done my best to make the tests complete, reliable, tolerant of system resource issues, hygenic, and fast (in that order) with the perspective that it's better to have Thespian handle as many of the possible scenarios as possible (instead of leaving them as pitfalls for the user to deal with) at the expense of testing being a bit of a pain. That said, the tests should still pass (modulo system resource issues) and I'm definitely interesting in resolving any failures you are seeing. |
@TTimo , I just released Thespian 3.9.8 which contains the socketopt change above. If you still have time to work on this, I'm happy to continue investigating the issues you've been seeing. |
Sounds good! I'll do a pass with latest. |
ran
I don't know if the logs out of TMP are very useful, pytest is spitting a lot of things to stdout/stderr otherwise but I didn't capture it. https://www.dropbox.com/s/ucy0fkkaj59dthr/thespian-3.9.8-python27-logs.zip?dl=0 |
I did a second run and captured the whole output: https://www.dropbox.com/s/fu6b5oekj6banq3/thespian-3.9.8-python27-logs-2.zip?dl=0 |
Thanks @TTimo. That's a lot of good info. I'm setting up some local Windows access to research those issues you are still seeing, because it's definitely not what I was expecting. I'll keep you updated. |
I am not sure if Windows is supported, and what functionality should be expected (all/same as on *nix?).
Here are various problems I am seeing on Windows 10:
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 17:00:18) [MSC v.1900 64 bit (AMD64)]
(same error happens with Python 2.7)
The text was updated successfully, but these errors were encountered: