Skip to content
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

Interrupted system call #166

Closed
bkanuka opened this issue Apr 4, 2015 · 5 comments · Fixed by #175
Closed

Interrupted system call #166

bkanuka opened this issue Apr 4, 2015 · 5 comments · Fixed by #175
Labels
bug Something isn't working feature New feature or request
Milestone

Comments

@bkanuka
Copy link
Contributor

bkanuka commented Apr 4, 2015

This is a bit of a cross-post because I'm not entirely sure where this bug lives. WebVirtMgr uses websockify somewhat unsuccessfully. See this bug.

The actual exception however, is happening in websocketproxy.py line 134. ins, outs, excepts = select(rlist, wlist, [], 1) is throwing a select.error error: (4, 'Interrupted system call')

If the select timeout is set to 0, things work but obviously at high CPU.

The bug linked above may actually be the fault of WebVirtMgr, but ideally websockify should be robust to whatever WebVirtMgr is doing.

bkanuka added a commit to bkanuka/websockify that referenced this issue Apr 5, 2015
@bkanuka
Copy link
Contributor Author

bkanuka commented Apr 5, 2015

A reasonable reaction to an "Interrupted system call" is to try again. My patch just catches and continues (a little trickery to catch just "Interrupted system call")

@vstinner
Copy link

A reasonable reaction to an "Interrupted system call" is to try again.

Yes. For select.select(), you may need to recompute the timeout. But in do_proxy() calls select() in a "while True" loop, so I'm not sure that the timeout matters. By the way, why select() is called with a timeout? It looks like active polling, whereas it should work without polling.

See also the PEP 475 which restarts interrupted syscalls in Python 3.5:
https://www.python.org/dev/peps/pep-0475/

@bkanuka
Copy link
Contributor Author

bkanuka commented Apr 19, 2015

select is called with a timeout so that it blocks for up to one second. Without it, select never blocks and the encasing while True spins as fast as it can. I think the net effect is that the timeout doesn't really matter (as long as it's not 0).

Re: Python 3.x - it's the reason my patch wasn't merged. I'm not too familiar with Python 3 and especially not with code that's cross-compatible. Will have to look into this (fingers crossed for today).

Thank you for looking at this.

@DirectXMan12 DirectXMan12 added feature New feature or request bug Something isn't working python labels Apr 28, 2015
@DirectXMan12 DirectXMan12 added this to the v0.7.0 milestone Apr 28, 2015
@psych0d0g
Copy link

@bkanuka after i've applied this patch, WebVirtMgr isnt connecting to spice at all anymore, without it connects but disconnects after few seconds like the initial issue, something seems not quite right here i guess

@bkanuka
Copy link
Contributor Author

bkanuka commented May 5, 2015

Whoa super good to know. Thanks! I'll look into it. Sorry this has totally
slipped away from me.
On May 5, 2015 16:13, "psych0d0g" [email protected] wrote:

@bkanuka https://github.com/bkanuka after i've applied this patch,
WebVirtMgr isnt connecting to spice at all anymore, without it connects but
disconnects after few seconds like the initial issue, something seems not
quite right here i guess

Reply to this email directly or view it on GitHub
#166 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants