Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block stream should be closed after used. #4992

Open
datbeohbbh opened this issue Sep 22, 2024 · 0 comments
Open

Block stream should be closed after used. #4992

datbeohbbh opened this issue Sep 22, 2024 · 0 comments

Comments

@datbeohbbh
Copy link

Current Status

var stream *blockStream
if stream, err = newBlockStream(mgr.rootDir, startFileNum, int64(startOffset), endFileNum); err != nil {
return err
}

A block stream is opened to sync block index. After used, we should close that block stream.

Expected

The block stream stream is closed after used.

Solution

simply add defer stream.close().

var stream *blockStream
if stream, err = newBlockStream(mgr.rootDir, startFileNum, int64(startOffset), endFileNum); err != nil {
	return err
}
defer stream.close() // close stream

Please let us know if you plan to work on this.

Maybe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant