From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#19860: 25.0.50; One url-retrieve-synchronously call running concurrently with another can freeze it Date: Sat, 14 Feb 2015 02:09:57 +0200 Message-ID: <86bnkxnyju.fsf@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1423872681 5127 80.91.229.3 (14 Feb 2015 00:11:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 Feb 2015 00:11:21 +0000 (UTC) To: 19860@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Feb 14 01:11:10 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YMQKD-0005Ji-Ra for geb-bug-gnu-emacs@m.gmane.org; Sat, 14 Feb 2015 01:11:10 +0100 Original-Received: from localhost ([::1]:58103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMQKD-0007bW-2x for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Feb 2015 19:11:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44843) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMQK9-0007aw-L9 for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:11:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMQK6-0000QE-D8 for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:11:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:51118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMQK6-0000QA-9B for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:11:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YMQK6-0002hb-0R for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Feb 2015 00:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19860 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.142387261510331 (code B ref -1); Sat, 14 Feb 2015 00:11:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Feb 2015 00:10:15 +0000 Original-Received: from localhost ([127.0.0.1]:42358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMQJK-0002gY-A1 for submit@debbugs.gnu.org; Fri, 13 Feb 2015 19:10:14 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42999) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YMQJI-0002gJ-Nr for submit@debbugs.gnu.org; Fri, 13 Feb 2015 19:10:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMQJC-0000Em-By for submit@debbugs.gnu.org; Fri, 13 Feb 2015 19:10:07 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:35675) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMQJC-0000DH-8q for submit@debbugs.gnu.org; Fri, 13 Feb 2015 19:10:06 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMQJA-0007Jg-W1 for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:10:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YMQJ7-0008WV-OO for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:10:04 -0500 Original-Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:33411) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YMQJ7-0008UZ-I3 for bug-gnu-emacs@gnu.org; Fri, 13 Feb 2015 19:10:01 -0500 Original-Received: by mail-wg0-f51.google.com with SMTP id y19so19634946wgg.10 for ; Fri, 13 Feb 2015 16:10:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:mime-version:content-type; bh=Orh76VgtGcZZVvQvVLF+dRGqPFdtebLxU3+wkajsGr4=; b=CIox0xY6r2XVpO21X2J4VXwctZ5Whb3+C6ISLUQ5vKg+BK+ASHaPh5YoD5acbZE+MS xcFNH6wHhqbd6t4hzTugPtvohOYDM8YAh/jObvNS5t3b7LNXJ0Rwbxi/CTu8SY2VdI2G XntYXZjZyfIZz6JOw372bRXXX8kBiJkYbImqzD0sioCyjLDFmdoLFd95C2D1cPoWFe8e 4x/d74E589B9CIC6waOyb2mlNvHGcVyHF+LtUo0+iO009tmwe5S9KI+B6d1JFicm6Cdf rbys/ZPLvkVwom3AiPlhzbdl0hKjiaAB2BAGdcyH92uXHJVqB9W9/b4vS9tUWhJ0HlbR uFZw== X-Received: by 10.180.21.162 with SMTP id w2mr11908805wie.42.1423872600828; Fri, 13 Feb 2015 16:10:00 -0800 (PST) Original-Received: from axl (static-nbl2-118.cytanet.com.cy. [212.31.107.118]) by mx.google.com with ESMTPSA id g10sm4889563wic.7.2015.02.13.16.09.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Feb 2015 16:10:00 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:99335 Archived-At: This applies both to master and emacs-24 (with a caveat). With sufficiently suitable server, calling long-ops-now or long-ops-idle can lead to the "outer" request never returning: --8<---------------cut here---------------start------------->8--- (defun long-ops-idle () (interactive) (run-with-idle-timer 0.2 nil #'long-outer-op) (run-with-idle-timer 0.5 nil #'long-inner-op)) (defun long-ops-now () (interactive) (run-with-timer 0.2 nil #'long-inner-op) (long-outer-op)) (defun long-outer-op () (message "retrieving outer") (url-retrieve-synchronously "http://localhost:9292") (message "outer retrieved")) (defun long-inner-op () (message "retrieving inner") (url-retrieve-synchronously "http://localhost:9292") (message "inner retrieved")) --8<---------------cut here---------------end--------------->8--- The window freezes, the last message in the echo area being "inner retrieved" (but C-g breaks out of it, and if we're calling `long-ops-idle', the "outer" request succeeds, too). It doesn't happen with just any web server, though. I can reproduce it using both master and emacs-24 using this Ruby server: --8<---------------cut here---------------start------------->8--- run proc { |env| sleep 1 [200, {'Content-Type' => 'text/plain'}, [""]] } --8<---------------cut here---------------end--------------->8--- Save it as test.ru and launch with 'rackup test.ru'. But only with master using this Python server (an example for those who don't have Ruby installed): --8<---------------cut here---------------start------------->8--- from wsgiref.util import setup_testing_defaults from wsgiref.simple_server import make_server import time def simple_app(environ, start_response): setup_testing_defaults(environ) status = '200 OK' headers = [('Content-type', 'text/plain')] time.sleep(1) start_response(status, headers) return "" httpd = make_server('', 9292, simple_app) print "Serving on port 9292..." httpd.serve_forever() --8<---------------cut here---------------end--------------->8--- Save it as server.py, and launch with 'python server.py'. The key difference seems to be Keep-Alive (enabled by default by WEBrick (Ruby); wsgiref doesn't support it at all). Adding "Connection: close" to the Ruby example server makes emacs-24 behave as expected with it. And someone who doesn't want to run the server can also try the following URLs with master: http://xip.io/ and http://ya.ru/. When calling xip.io, the outer request eventually returns, but much later than expected; when calling ya.ru, it doesn't. The present bug report is based on this long-standing issue, which I haven't been able to reliably reproduce until now: https://github.com/dgutov/robe/issues/36 In GNU Emacs 25.0.50.5 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2015-02-13 on axl Repository revision: 69e38a5b1fdb5ac20440b6ce7ba1fc2cd575f4e6 Windowing system distributor `The X.Org Foundation', version 11.0.11601901 System Description: Ubuntu 14.10