Prevent panics due to EOF in gob.Decode #5

Merged
6543 merged 3 commits from zeripath/session:no-more-EOF-panic into master 2022-12-20 00:55:50 +00:00
Owner

If a session file has been truncated due to server disk errors then the FileReader may return an io.EOF error on Read().

This then percolates up to the session manager which will panic.

This PR instead suggests that we simply swallow this error and start off again with empty session data.

Signed-off-by: Andrew Thornton art27@cantab.net

If a session file has been truncated due to server disk errors then the FileReader may return an io.EOF error on Read(). This then percolates up to the session manager which will panic. This PR instead suggests that we simply swallow this error and start off again with empty session data. Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added 1 commit 2022-12-19 13:10:46 +00:00
Prevent panics due to EOF in gob.Decode
All checks were successful
continuous-integration/drone/pr Build is passing
522faccee0
If a session file has been truncated due to server disk errors then the FileReader may return an io.EOF error on Read().

This then percolates up to the session manager which will panic.

This PR instead suggests that we simply swallow this error and start off again with empty session data.

Signed-off-by: Andrew Thornton <art27@cantab.net>
zeripath added 1 commit 2022-12-19 13:11:39 +00:00
Update 'file.go'
All checks were successful
continuous-integration/drone/pr Build is passing
4d70fcf0cb
wxiaoguang approved these changes 2022-12-19 13:13:38 +00:00
Owner

Maybe it caused by a disk or file system problem? Should we still continue ignore the error?

Maybe it caused by a disk or file system problem? Should we still continue ignore the error?
techknowlogick approved these changes 2022-12-19 21:18:13 +00:00
techknowlogick added 1 commit 2022-12-19 21:18:22 +00:00
Merge branch 'master' into no-more-EOF-panic
All checks were successful
continuous-integration/drone/pr Build is passing
15afcca0bc
6543 approved these changes 2022-12-20 00:55:39 +00:00
6543 merged commit e056dc3791 into master 2022-12-20 00:55:50 +00:00
6543 added the
bug
label 2022-12-20 00:56:00 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: go-chi/session#5
No description provided.