uw-labs/substrate

[bug] freezer panics on missing folder

Closed this issue · 2 comments

We found an issue with freezer, it seems to try and it appears to be failing on this line:

https://github.com/uw-labs/freezer/blob/master/dirs.go#L41

From we can tell it looks like it's either a bug that there's a rogue folder in the data directory or there's a race condition where it's trying to read the directory before it has been fully created.

Stacktrace is below:

github.com/uw-labs/freezer.NewMessageSink(0xde5ac0, 0xc0001dc8a0, 0xc00004a046, 0x10, 0x0, 0xc00012c380, 0x30, 0xc00004a016)
u0009/go/pkg/mod/github.com/uw-labs/freezer@v0.0.0-20190109115355-f22cdee36346/dirs.go:41 +0x444
u0009/go/pkg/mod/github.com/uw-labs/substrate@v0.0.0-20190313170542-67626b38e3a2/freezer/freezer_url.go:71 +0x2ec
github.com/urfave/cli.HandleAction(0xbbf9e0, 0xcf08d0, 0xc000270420, 0xc0001fe4e0, 0x0)
u0009/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:488 +0x101
u0009/go/pkg/mod/github.com/urfave/cli@v1.20.0/app.go:264 +0x59d
github.com/urfave/cli.HandleAction(0xbbf9e0, 0xcf08d0, 0xc0001986e0, 0xc0000827e0, 0x0)
panic: runtime error: index out of range
github.com/uw-labs/freezer.nextSequence(0xde5ac0, 0xc000281650, 0xc000044046, 0x10, 0xc00031e680, 0x0, 0x0)
u0009/go/pkg/mod/github.com/uw-labs/freezer@v0.0.0-20190109115355-f22cdee36346/dirs.go:41 +0x444
github.com/urfave/cli.HandleAction(0xbbf9e0, 0xcf08d0, 0xc00018c580, 0xc00017a780, 0x0)
u0009/home/circleci/project/main.go:100 +0x463
u0009/go/pkg/mod/github.com/uw-labs/substrate@v0.0.0-20190313170542-67626b38e3a2/suburl/sink.go:44 +0xef
goroutine 1 [running]:
github.com/urfave/cli.(*App).Run(0xc000207520, 0xc0000a2190, 0x1, 0x1, 0x0, 0x0)
main.main()

I suspect this is not a substrate issue, but a freezer one.