cherrypy / cherrypy

CherryPy is a pythonic, object-oriented HTTP framework. https://cherrypy.dev
https://docs.cherrypy.dev
BSD 3-Clause "New" or "Revised" License
1.8k stars 357 forks source link

Server state tests fail on windows xp dual core box, possible threading issue #348

Closed ghost closed 8 years ago

ghost commented 18 years ago

Originally reported by: anonymous (Bitbucket: anonymous, GitHub: Unknown)


under windows xp, rc2 fails to execute the test suite. rc1 works fine

ERROR: test_1_Restart (test_states.ServerStateTests)

Traceback (most recent call last): File "C:\Python24\Lib\site-packages\cherrypy\test\webtest.py", line 249, in call testMethod() File "C:\Python24\Lib\site-packages\cherrypy\test\test_states.py", line 133, in test_1_Restart cherrypy.server.restart() File "C:\Python24\Lib\site-packages\cherrypy_cpserver.py", line 262, in restart self.start_http_server() File "C:\Python24\Lib\site-packages\cherrypy_cpserver.py", line 177, in start_http_server self.wait_for_http_ready() File "C:\Python24\Lib\site-packages\cherrypy_cpserver.py", line 190, in wait_for_http_ready wait_for_occupied_port(host, port) File "C:\Python24\Lib\site-packages\cherrypy_cpserver.py", line 368, in wait_for_occupied_port raise cherrypy.NotReady("Port not bound.") NotReady: Port not bound.


ghost commented 15 years ago

Original comment by Nick Kamper (Bitbucket: nick125, GitHub: nick125):


I'm not entirely sure what that error has to do with this ticket. It sounds like something else on your system is opened on port 80.

ghost commented 16 years ago

Original comment by guest (Bitbucket: guest, GitHub: guest):


I have the Pentium IV dual core and cannot run the simple helloworld.py tutorial with CherryPy 2.3.0

06/Apr/2008:01:24:40 CONFIG INFO server.socket_file: 06/Apr/2008:01:24:40 CONFIG INFO server.reverse_dns: False 06/Apr/2008:01:24:40 CONFIG INFO server.socket_queue_size: 5 06/Apr/2008:01:24:40 CONFIG INFO server.thread_pool: 10 06/Apr/2008:01:24:46 HTTP INFO Port 80 not free on '127.0.0.1' Unhandled exception in thread started by <bound method Server._start of <cherryp y._cpserver.Server object at 0x00CF7F90>> Traceback (most recent call last): File "c:\dev\python251\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy_cp server.py", line 79, in _start self.start_http_server() File "c:\dev\python251\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy_cp server.py", line 99, in start_http_server wait_for_free_port(host, port) File "c:\dev\python251\lib\site-packages\cherrypy-2.3.0-py2.5.egg\cherrypy_cp server.py", line 252, in wait_for_free_port raise cherrypy.NotReady("Port not free.") cherrypy._cperror.NotReady: Port not free.

ghost commented 18 years ago

Original comment by Anonymous:


I did some investigation... Test suite runs fine if test_states is not run. All state tests run fine for the serverless state tests. wsgi state tests run fine if restart test is not run. Only the normal flow state test works for the the pooled thread server state test. For the http server, again, restart throws in the towel.

As far as i can tell, the issue isn't a network problem, but a threading problem. The above error occurs because the port is never freed, and thus is in use, and fails to be rebound. I have carefully tested quite a few other networking apps, without incident.

I believe that these errors become apparent on my development system, as I am using a dual core pentium IV. Multiple processors on a particular os can often expose threading issues that don't occur on single processor systems, or on multi processor systems with other another os.

Please test again with a dual core system xp system. Thanks!

ghost commented 18 years ago

Original comment by Anonymous:


Probably caused by some network setup problem on this perticular computer

ghost commented 18 years ago

Original comment by anonymous (Bitbucket: anonymous, GitHub: Unknown):


Addendum... all of the tutorials do, however execute without problem