unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: AlexHarsanyi@gmail.com, fitzsim@fitzsim.org,
	monnier@iro.umontreal.ca, 73199@debbugs.gnu.org
Subject: bug#73199: url-retrieve is not thread-safe
Date: Thu, 10 Oct 2024 13:29:42 +0200	[thread overview]
Message-ID: <87h69kp55l.fsf@gmx.de> (raw)
In-Reply-To: <87wmiq8nv4.fsf@gmx.de> (Michael Albinus's message of "Wed, 02 Oct 2024 18:34:55 +0200")

Michael Albinus <michael.albinus@gmx.de> writes:

> Eli Zaretskii <eliz@gnu.org> writes:
>
>>> From: Michael Albinus <michael.albinus@gmx.de>
>>> Cc: 73199@debbugs.gnu.org,  AlexHarsanyi@gmail.com,  fitzsim@fitzsim.org,
>>>   monnier@iro.umontreal.ca
>>> Date: Mon, 30 Sep 2024 18:42:55 +0200
>>>
>>> Oops, sorry. I've appended the vc-dir buffer, not the vc-diff ...
>>
>> Thanks.  I'd appreciate if you could explain why url-retrieve is
>> currently not thread-safe, and how this patch is supposed to solve
>> that.
>
> In <https://debbugs.gnu.org/cgi/bugreport.cgi?bug=73199#14>, there's a
> recipe for reproduction.
>
> The general problem is when you want to access the same HTTP server from
> a different thread, and url-http-attempt-keepalives is set to t. This
> happens, for example, in debbugs 0.41.
>
> Let's assume, there is an access to debbugs:443 from a given thread, for
> example the main thread. Soap-client serves. It also binds
> url-http-attempt-keepalives to t, the https process stays alive.
>
> Later on, there is an access to debbugs:443 from another thread. It
> checks, whether there is a running process for that target, and tries to
> reuse. We get the error
>
> Error #<thread debbugs>: (error "Attempt to accept output from process debbugs.gnu.org locked to thread #<thread 0xc288a0>")
>
> My patch tries to fix this. The list of still open processes is the hash
> table url-http-open-connections. It has the ky (cons host port), and as
> value a list of processes.
>
> My patch changes this such a way, that the key is now (list host port
> thread). Therefore, only open processes which belong to the same thread
> are checked.
>
> This seems to work sufficiently.

Ping. Any comments? Otherwise, I'll install the patch in a couple of days.

Best regards, Michael.





  parent reply	other threads:[~2024-10-10 11:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 14:20 bug#73199: soap-client; soap-invoke-internal is not thread-safe Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 14:06 ` Thomas Fitzsimmons
2024-09-20  9:58   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]     ` <87wmit9nvh.fsf_-_@gmx.de>
2024-09-30 15:40       ` bug#73199: url-retrieve " Eli Zaretskii
2024-09-30 16:42         ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-30 17:38           ` Eli Zaretskii
2024-10-02 16:34             ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-02 18:30               ` Eli Zaretskii
2024-10-10 11:29               ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-10-10 13:10                 ` Eli Zaretskii
2024-10-11 10:44                   ` Michael Albinus via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h69kp55l.fsf@gmx.de \
    --to=bug-gnu-emacs@gnu.org \
    --cc=73199@debbugs.gnu.org \
    --cc=AlexHarsanyi@gmail.com \
    --cc=eliz@gnu.org \
    --cc=fitzsim@fitzsim.org \
    --cc=michael.albinus@gmx.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).