• Kirill Smelkov's avatar
    go/zodb: Require drivers to close watchq on Close · a5dbb92b
    Kirill Smelkov authored
    If we don't require drivers to stop sending to watchq after Close, there
    could be many deadlock scenarios, for example:
    
    - client called drv.Close(); no longer listens to watchq; driver is
      stuck sending to watchq, or
    
    - client called drv.Close(), which itself waits for tasks spawned inside
      driver to complete, which are stuck sending to watchq because client
      no longer does <-watchq.
    
    The change is similar in spirit to safety guaranty provided by high-level
    Watcher where after DelWatch call it is guaranteed that there will be no
    more sends to subscribed watchq (see c41c2907 "go/zodb: High-level
    watching - initial draft") for details.
    
    All drivers don't provide requested guarantee yet.
    We'll be fixing them one-by-one in followup commits.
    a5dbb92b
storage.go 13.3 KB