Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 15269fb736f0fa57e0749d2bbe2174c5bceab5cca7a3403805400be681e28296
Ticket: 824251ffffffffffffffffffffffffffffffffff
async client sockets block for DNS
User & Date: kjnash on 2022-09-08 16:47:51
Changes

  1. assignee changed to: "aku"
  2. closer changed to: "nobody"
  3. comment changed to:
    The geturl documentation claims that, geturl will
    return immediatly with a token if the -command option
    is invoked.
    If geturl can not make the initial socket connection to
    a url, it blocks until the timeout expires and calls
    the -command proc before geturl has returned a token.
    This causes at least the following two problems:
    
    1. The block causes any following geturl calls to hang
    before processing. This destroys the asynchronious
    operation.
     
    2. It invokes the -command proc with a token that is as
    yet unknown to the general  processing loop.
    
    [email protected]
    
  4. icomment:
    I have added a workaround to 8.7 [608f2fbab4].
    
    The ::socket command is evaluated asynchronously in another thread while the script waits in the event loop.  Because the Thread package may not be present, the new facility is optional and is switched off by default.  Its use is controlled by the new http::config option -threadlevel.
    
    The new code runs in an idletask coroutine. This uses a trace to detect command completion, hence avoiding the stacking issues of vwait.
    
    The socket replacement command http::socket is short, and if desired it can easily be replaced with one that uses a different technique.
    
  5. login: "kjnash"
  6. mimetype: "text/x-fossil-plain"
  7. severity changed to: "Minor"