Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66589

select(sock) indicates not-ready, but sock.recv does not block

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <Nikolaus@rath.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'subject:not': 0.03; 'preferred.': 0.05; 'here?': 0.09; 'pgp': 0.09; 'python': 0.11; '(),': 0.16; 'fingerprint:': 0.16; 'fruit': 0.16; 'reliably': 0.16; 'reproduce': 0.16; 'select.': 0.16; 'subject:ready': 0.16; 'thanks,': 0.17; 'result.': 0.19; 'header:User-Agent:1': 0.23; 'idea': 0.28; 'subject:) ': 0.29; "i'm": 0.30; 'anyone': 0.31; 'linux': 0.33; 'running': 0.33; 'problem': 0.35; 'skip:s 30': 0.35; 'but': 0.35; 'seconds': 0.37; 'wrong': 0.37; '(i.e.,': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; 'situation': 0.65; '100%': 0.77; 'condition.': 0.84; 'flies': 0.84; 'encrypted': 0.91; 'race': 0.95
From Nikolaus Rath <Nikolaus@rath.org>
To python-list@python.org
Subject select(sock) indicates not-ready, but sock.recv does not block
Mail-Copies-To never
Mail-Followup-To python-list@python.org
Date Sun, 16 Feb 2014 22:35:22 -0800
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7083.1392618926.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392618926 news.xs4all.nl 2839 [2001:888:2000:d::a6]:47863
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66589

Show key headers only | View raw


Hello,

I have a problem with using select. I can reliably reproduce a situation
where select.select((sock.fileno(),), (), (), 0) returns ((),(),())
(i.e., no data ready for reading), but an immediately following
sock.recv() returns data without blocking.

I am pretty sure that this is not a race condition. The behavor is 100%
reproducible, the program is single threaded, and even waiting for 10
seconds before the select() call does not change the result.

I'm running Python 3.3.3 under Linux 3.12.

Has anyone an idea what might be going wrong here?

Thanks,
-Nikolaus

-- 
Encrypted emails preferred.
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

             »Time flies like an arrow, fruit flies like a Banana.«

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

select(sock) indicates not-ready, but sock.recv does not block Nikolaus Rath <Nikolaus@rath.org> - 2014-02-16 22:35 -0800
  Re: select(sock) indicates not-ready, but sock.recv does not block Roy Smith <roy@panix.com> - 2014-02-17 08:04 -0500

csiph-web