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

enbility / ship-go / 28788123488
93%

Build:
DEFAULT BRANCH: dev
Ran 06 Jul 2026 11:29AM UTC
Jobs 1
Files 45
Run time 1min
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

06 Jul 2026 11:26AM UTC coverage: 92.985% (+0.03%) from 92.952%
28788123488

push

github

web-flow
ship: tear down connection on a failed spine data write (#86)

Fix https://github.com/evcc-io/evcc/issues/31465

Found while chasing an intermittent double-connection related test hang
in evcc (evcc-io/evcc#31493) that reproduces on top of #85's dedup fix.

`sendSpineData` only calls `CloseConnection` when
`IsDataConnectionClosed()` already reports the connection closed:

```go
if isClosed, err := c.dataWriter.IsDataConnectionClosed(); isClosed {
    c.CloseConnection(false, 0, "")
    return err
}
...
err = c.dataWriter.WriteMessageToWebsocketConnection(shipMsg)
if err != nil {
    logging.Log().Debug("error sending message: ", err)
    return err
}
```

If the actual websocket write fails for any other reason (e.g. the
remote already closed the connection before this side's writer noticed),
the error is logged and swallowed, but the connection is never torn
down. The `ShipConnection` stays registered as the current writer for
that SKI, so every subsequent send silently fails forever and the SKI is
never freed for a fresh connection attempt.

This surfaced concretely while stress-testing a double-connection race
scenario: after one side's connection was implicitly invalidated, the
other kept retrying sends against it every couple of seconds
indefinitely ("Error sending spine message: connection closed for remote
SKI ...", repeating), and no reconnect was ever attempted.

Fix: also call `CloseConnection(false, 0, "")` when the write itself
errors, mirroring the existing `IsDataConnectionClosed` branch. Updated
`TestSendSpineData_WriteError` to expect the resulting
`HandleConnectionClosed` call.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

3 of 3 new or added lines in 1 file covered. (100.0%)

2 existing lines in 1 file now uncovered.

5806 of 6244 relevant lines covered (92.99%)

12481.14 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
81.11
0.0% cert/cert.go
Jobs
ID Job ID Ran Files Coverage
1 28788123488.1 06 Jul 2026 11:29AM UTC 45
92.99
GitHub Action Run
Source Files on build 28788123488
  • Tree
  • List 45
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #28788123488
  • 7cc6ce52 on github
  • Prev Build on dev (#26030742651)
  • Next Build on dev (#28795888195)
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