From owner-freebsd-python@FreeBSD.ORG Wed Mar 9 01:12:00 2011 Return-Path: Delivered-To: freebsd-python@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5A9F1065670 for ; Wed, 9 Mar 2011 01:12:00 +0000 (UTC) (envelope-from steffenbeyer@windit.de) Received: from mail.windit.de (mail.windit.de [178.63.133.156]) by mx1.freebsd.org (Postfix) with ESMTP id 66AB98FC0C for ; Wed, 9 Mar 2011 01:12:00 +0000 (UTC) Received: from mail.windit.de (localhost [127.0.0.1]) by mail.windit.de (Postfix) with ESMTP id BA6F0512386 for ; Wed, 9 Mar 2011 01:53:16 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bronco.windit.de X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 Received: from [10.213.5.149] (p5DD3F389.dip.t-dialin.net [93.211.243.137]) by mail.windit.de (Postfix) with ESMTPSA for ; Wed, 9 Mar 2011 01:53:16 +0100 (CET) Date: Wed, 9 Mar 2011 01:53:13 +0100 From: Steffen Beyer To: freebsd-python@freebsd.org Message-ID: <20110309015313891650.33a231fb@windit.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Organization: WINDIT GbR X-Mailer: GyazMail version 1.5.10 Subject: socket.settimeout breaks HTTP server X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2011 01:12:00 -0000 Hi, after some debugging of a WebDAV server (trytond), dropping connections shortly after accepting them, I found the issue: class BaseThreadedHTTPServer(SocketServer.ThreadingMixIn, BaseHTTPServer.HTTPServer): def server_bind(self): # Python < 2.6 doesn't handle self.timeout self.socket.settimeout(1) (http://hg2.tryton.org/trytond/file/28c6cc9fe39f/trytond/protocols/webdav.py#l83) It runs fine after removing the call to "settimeout". The value does not seem to make a difference. I guess, this works for other OSs as the software is in production. It fails however in a FreeBSD 8.1 jail. What's the cause of the problem? How can I fix it without breaking it for other people? Kind regards, -- Steffen Beyer WINDIT GmbH Holtenauer Str. 57 24105 Kiel Fon: +49 (0)431 556 8342-0 Fax: +49 (0)431 556 8342-9 Web: http://www.windit.de