Bug 7845 - Unbuffered /dev/vx0-output from Python 1.5.1 hangs CPU in a busy wait
Summary: Unbuffered /dev/vx0-output from Python 1.5.1 hangs CPU in a busy wait
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Thomas Gellekum
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 1998-09-07 08:40 UTC by ga
Modified: 2000-01-14 01:58 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ga 1998-09-07 08:40:00 UTC
Using the standard SocketServer.py hangs the CPU in a busy wait.

The SocketServer.py normally does a :
self.wfile = self.connection.makefile( 'wb', 0 ) # unbuffered IO
this courses the CPU to hang in its self.wfile.write() ( socket write ) ...

Fix: 

Doing :
self.wfile = self.connection.makefile( 'wb', -1) # defaultbuffered IO
works just great as far as I can see.
How-To-Repeat: Run the SimpleHTTPServer.py and put some load on it. 
I simulated 50 concurrent users giving a total of 5 hits/sec. 

Kill the calling browsers brutally so that when the web-server 
writes to the socket on which the client emitted its call, 
the client is not there anymore.

This will course the web-server to hang in its self.wfile.write()...
Comment 1 Steve Price freebsd_committer freebsd_triage 1998-09-07 22:57:14 UTC
Responsible Changed
From-To: gnats-admin->freebsd-ports

Misfiled PR. 
Comment 2 Steve Price freebsd_committer freebsd_triage 1998-12-24 21:02:02 UTC
Responsible Changed
From-To: freebsd-ports->tg

Over to port's maintainer. 
Comment 3 Steve Price freebsd_committer freebsd_triage 1999-12-31 23:03:51 UTC
State Changed
From-To: open->feedback

Does this problem still exist with the latest version of the port? 
Comment 4 Steve Price freebsd_committer freebsd_triage 2000-01-14 01:56:16 UTC
State Changed
From-To: feedback->closed

Originator says that he could not make it work in FreeBSD and isn't 
using it anymore.  Since this is a very old PR and several newer 
versions of Python have come and gone, we'll cross our fingers that 
the problem has been resolved and close this PR.