Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: d2c4d294fe0073400138cd2fabec9b88fc682e5b5dbfacd93b01dbc9628e0d22
Ticket: 7aa8fd34c4e8ed00e73e06aef189fae1b092d1c4
epoll notifier spins and never reports writable after EPOLLERR
User & Date: jan.nijtmans on 2026-10-30 09:40:46
Changes

  1. assignee changed to: "jan.nijtmans"
  2. closedate changed to: "2461343.9033190627"
  3. closer changed to: "jan.nijtmans"
  4. comment changed to:
    On Linux (epoll notifier, 8.7 and later), a writable handler on a pipe whose reader has exited never fires: EPOLLERR is translated only to TCL_EXCEPTION, and the level-triggered event wakes epoll_wait() again at once, so the process spins at 100% CPU. A background flush to such a pipe never ends, and <nowiki>[close]</nowiki> reports no error although the data was lost.
    
    <verbatim>
    set f [open |[list [info nameofexecutable] exit.tcl] w]   ;# child exits at once
    fconfigure $f -blocking 0
    puts -nonewline $f [string repeat x 300000]
    catch {flush $f}
    chan event $f writable {set w writable}
    after 3000 {set w timeout}
    vwait w   ;# 8.6: writable at once, close gives "broken pipe"; 9.x: timeout, close gives no error
    </verbatim>
    
    select() reports such a descriptor as writable. The code is from [858569fb04].
    
  5. icomment:
    Fixed in [6d788a0eb3|trunk], and core-9-0-branch
    
    Many thanks!
    
  6. login: "jan.nijtmans"
  7. mimetype: "text/x-fossil-wiki"
  8. resolution changed to: "Fixed"
  9. status changed to: "Closed"