lflare / mdathome-golang

An unofficial rewrite of the official MangaDex@Home client, with focus on performance and reliability!
GNU Affero General Public License v3.0
27 stars 8 forks source link

Occasional panic on db shrinking #5

Open Tristan971 opened 3 years ago

Tristan971 commented 3 years ago

As per messages on discord, I occasionally see this (running v1.5.4), and it seems to only happen right after the Shrinking database... message

2020-11-07T23:34:11Z Current diskcache size: 199.2 GiB, limit: 195.3 GiB
2020-11-07T23:34:11Z Shrinking diskcache size: 199.2 GiB, limit: 195.3 GiB
panic: runtime error: slice bounds out of range [:2] with length 0

goroutine 21 [running]:
github.com/lflare/mdathome-golang/pkg/diskcache.(*Cache).DeleteFile(0xc000579800, 0x0, 0x0, 0x2, 0x2)
github.com/lflare/mdathome-golang/pkg/diskcache/diskcache.go:17 +0x2ef
github.com/lflare/mdathome-golang/pkg/diskcache.(*Cache).StartBackgroundThread(0xc000579800)
github.com/lflare/mdathome-golang/pkg/diskcache/diskcache.go:166 +0x3c5
created by github.com/lflare/mdathome-golang/pkg/diskcache.New
github.com/lflare/mdathome-golang/pkg/diskcache/diskcache.go:256 +0x17f

And some more cases (last 6 hours)

2020-11-07 23_59_11-System - Overview - Grafana - Personal - Microsoft​ Edge