• Levin Zimmermann's avatar
    wcfs: Fix protection against faulty client · b02dcadc
    Levin Zimmermann authored
    The WCFS documentation specifies [1]:
    
    - - - 8> - - - 8> - - -
    
    If a client, on purpose or due to a bug or being stopped, is slow to respond
    with ack to file invalidation notification, it creates a problem because the
    server will become blocked waiting for pin acknowledgments, and thus all
    other clients, that try to work with the same file, will get stuck.
    
    [...]
    
    Lacking OS primitives to change address space of another process and not
    being able to work it around with ptrace in userspace, wcfs takes approach
    to kill a slow client on 30 seconds timeout by default.
    
    - - - <8 - - - <8 - - -
    
    But before this patch, this protection wasn't implemented yet: one
    faulty client could therefore freeze the whole system. With this patch
    this protection is implemented now: faulty clients are killed after the
    timeout.
    
    [1] https://lab.nexedi.com/nexedi/wendelin.core/blob/38dde766/wcfs/wcfs.go#L186-208
    b02dcadc
wcfs.go 79.6 KB