Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4a84a29b8efe32a6e42f5e984bb5c43b4ef9ab2b
Ticket: 2762041fffffffffffffffffffffffffffffffff
Fix (too) early recognition of EOF in a channel stack
User & Date: andreas_kupries on 2010-02-23 05:16:01
Changes

  1. icomment:
    Regarding "that case the buffered zlib'd input is not properly passed down the stack."
    
    You are looking into the wrong direction. This is about _input_. Input walks _up_ the stack.
    And while a transformation is able to flush data waiting in its state down the stack on chan pup, thus flushing _write_ buffers, the same is not possible for data waiting _read_ buffers/state. They have nowhere to go. Reading is demand-driven from the core I/O layer, the driver cannot announce 'hey here is some data to splace into your input buffer queue.
    
    This means data waiting to be read at the time 'chan pop' is done (or C equivalent) is _lost_.
    
    And this seems to me to be case here. Sometimes, the 'close' is done early, before all the decompressed data has been read out of the zlib state.
    
    I have seen the http-2.6 test failing and succeeding here now. More fail, but sometimes it is ok. And for that case my trace of the zlib transform internals shows 16 calls of ZlibTransformInput after the initial call of same which pulled the data from the base channel. In the failing case none of these additional calls happen, only the ZlibTransformClose immediately after the initial call pulling data ... It really looks like a race to me where the close is done early, causing the pending data to be lost per the explanation above.
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"