mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
ReadNeedleMeta recovery panic occurred (#3883)
ReadNeedleMeta panic occurred https://github.com/seaweedfs/seaweedfs/issues/3882
This commit is contained in:
parent
e3ea544d40
commit
452202f35b
|
@ -1,6 +1,7 @@
|
||||||
package needle
|
package needle
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/glog"
|
"github.com/seaweedfs/seaweedfs/weed/glog"
|
||||||
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
|
"github.com/seaweedfs/seaweedfs/weed/storage/backend"
|
||||||
. "github.com/seaweedfs/seaweedfs/weed/storage/types"
|
. "github.com/seaweedfs/seaweedfs/weed/storage/types"
|
||||||
|
@ -30,6 +31,11 @@ func (n *Needle) ReadNeedleData(r backend.BackendStorageFile, volumeOffset int64
|
||||||
|
|
||||||
// ReadNeedleMeta fills all metadata except the n.Data
|
// ReadNeedleMeta fills all metadata except the n.Data
|
||||||
func (n *Needle) ReadNeedleMeta(r backend.BackendStorageFile, offset int64, size Size, version Version) (err error) {
|
func (n *Needle) ReadNeedleMeta(r backend.BackendStorageFile, offset int64, size Size, version Version) (err error) {
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
err = fmt.Errorf("panic occurred: %+v", r)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
bytes := make([]byte, NeedleHeaderSize+DataSizeSize)
|
bytes := make([]byte, NeedleHeaderSize+DataSizeSize)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue