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

datatug / datatug-core / 34393684711
100%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2026 07:12PM UTC
Jobs 1
Files 114
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

09 Sep 2026 07:12PM UTC coverage: 92.178% (+0.1%) from 92.078%
34393684711

push

github

web-flow
fix(filestore): remove the data race in loadSchemaModel fan-out (#314)

loadSchemaModel spawned two parallel.Run closures that both wrote directly
to the shared schemaModel.Tables field (one for "tables", one for
"views"). Besides being a data race (WARNING: DATA RACE at
loader_internals.go:152/156), this silently dropped whichever half
finished first: the last writer's result clobbered the other's, so a
loaded schema was nondeterministically missing its tables or its views.
Fixed by giving each goroutine its own local slice and merging them after
parallel.Run returns.

The same loadDir-based fan-out pattern (a goroutine per file/dir, writing
into a shared collection via the loader callback) had the identical bug at
three more call sites that were dropping the mutex loadDir already threads
through for exactly this purpose:
- loadDbModel: unguarded `dbModel.Schemas = append(...)`
- loadDbCatalogs: unguarded `dbServer.Catalogs = append(...)`, plus a
  second race on the outer named-return `err` (the loader closure had no
  named return of its own, so `err =` wrote loadDbCatalogs' return value
  from every worker goroutine)
- loadTables: unguarded `tables = append(...)`

All four now use the mutex (or per-goroutine locals) loadDir/parallel.Run
already make available. loadDbCatalog's index-based schema writes and
loadSchema's writes to the distinct Tables/Views fields were reviewed and
left untouched - they don't share memory across goroutines.

Extended TestLoaderInternals/loadDbModel, loadDbCatalogs and loadTables to
use 2+ schemas/catalogs/tables so the fan-out actually runs concurrent
work; loadDbModel also asserts both tables and views survive the merge.
`go test -race -count=20 ./pkg/storage/filestore/...` is clean.

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>

18 of 20 new or added lines in 1 file covered. (90.0%)

4714 of 5114 relevant lines covered (92.18%)

0.92 hits per line

Uncovered Changes

Lines Coverage ∆ File
2
80.37
3.37% pkg/storage/filestore/loader_internals.go
Jobs
ID Job ID Ran Files Coverage
1 34393684711.1 09 Sep 2026 07:12PM UTC 114
92.18
GitHub Action Run
Source Files on build 34393684711
  • Tree
  • List 114
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 8077326a on github
  • Prev Build on main (#34389064767)
  • Next Build on main (#34394808506)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc