• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lorenzodonini / ocpp-go / 24061322700 / 1
83%
master: 83%

Build:
Build:
LAST BUILD BRANCH: fix/mocks
DEFAULT BRANCH: master
Ran 07 Apr 2026 02:32AM UTC
Files 54
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

07 Apr 2026 02:29AM UTC coverage: 82.86% (+0.04%) from 82.818%
24061322700.1

Pull #414

github

shiv3
fix: prevent deadlock in websocket write during connection cleanup

When many connections disconnect simultaneously (e.g. cluster autoscaler
pod restart), a deadlock can occur between WriteManual/Close and cleanup:

1. WriteManual holds w.mutex.RLock and blocks on outQueue send (buffer full,
   writePump no longer reading because it exited to call cleanup)
2. cleanup waits for w.mutex.Lock, which requires all RLock holders to release
3. Neither can proceed -> deadlock

Additionally, server.Write held s.connMutex.RLock during the entire w.Write
call. If w.Write blocked, it prevented all handleDisconnect calls (which need
s.connMutex.Lock) across all connections, causing cascading "already exists"
errors when charge points attempted to reconnect.

Fix:
- Add a done channel to webSocket, closed at the start of cleanup
- Use select in WriteManual and Close to abort when done is signaled
- Release s.connMutex.RLock in server.Write before calling w.Write
Pull Request #414: fix: prevent deadlock in websocket write during connection cleanup

3732 of 4504 relevant lines covered (82.86%)

18.18 hits per line

Source Files on job 24061322700.1
  • Tree
  • List 54
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 24061322700
  • da417ac2 on github
  • Prev Job for on fix/ws-write-deadlock (#17022091823.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc