Repository navigation
lib/db: Don't ignore failures unmarshaling version lists - #6411
Conversation
|
There's a subtle difference in that before in these places we skipped/continued for empty version lists, whereas now we just continue processing. I didn't look to see if the behavior is the same (I guess we'll typically loop over the versions, which is still a no-op), and I guess we generally shouldn't have any empty version lists either... |
|
Right, it'll panic here and there if there are empty lists. Which there shouldn't be. But then we'll see it in sentry. So, Ok, I guess. |
* master: lib/db: Use need func in withNeed and simplify (syncthing#6412) cmd/syncthing: Do auto-upgrade before startup (fixes syncthing#6384) (syncthing#6385)
Sorry, should have made that explicit: It does panic and I considered that ok, because it must never happen and if it does, it will have other consequences (db inconsistencies) and I'd rather know about them to have a chance of fixing it. Maybe it would be cleaner to check for empty version lists and return an error, instead of panicking due to an index out of range (the end result will still be a panic). |
* master: lib/protocol: Zero pad index ID strings lib/db: Don't ignore failures unmarshaling version lists (syncthing#6411) lib/db: Use need func in withNeed and simplify (syncthing#6412) cmd/syncthing: Do auto-upgrade before startup (fixes syncthing#6384) (syncthing#6385) lib/db: Extend set test with second remote (syncthing#6402) gui, man, authors: Update docs, translations, and contributors lib/protocol: Use BlocksHash to compare block lists when available (syncthing#6401) lib/api: Ignore that one file that always shows up in git status
Doing other db work I noticed that
VersionListis the only type where unmarshalling errors and invalid contents (empty) is just accepted and not acted on (neither fixed nor an error returned). For anything else, we just return the error. Looking at the history I don't see anything that justifies a special treatment forVersionList. Checkglobal now deletes invalid global entries and everywhere else they are just unmarshalled and an error is returned if invalid.