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

Rocksdb handle EINTR incorrectly #6509

Closed
ChinaXing opened this issue Mar 11, 2020 · 2 comments
Closed

Rocksdb handle EINTR incorrectly #6509

ChinaXing opened this issue Mar 11, 2020 · 2 comments

Comments

@ChinaXing
Copy link

ChinaXing commented Mar 11, 2020

from the location of following:

} while (r == 0 && ferror(file_) && errno == EINTR);

the test of ferror shuold call clearerr before into next loop
if not so, empty file plus interrupt by signal will cause the loop can't break

this happened when we inject EINTR to write syscall. after cancel the injection.

thread's errno isn't be cleared, so this loop can't break.

itsbilal added a commit to cockroachdb/rocksdb that referenced this issue Mar 11, 2020
This change updates PosixSequentialFile::Read to call clearerr()
before fread()ing again after an EINTR is returned on a previous
fread.

Proactive fix for facebook#6509
itsbilal added a commit to cockroachdb/rocksdb that referenced this issue Mar 12, 2020
This change updates PosixSequentialFile::Read to call clearerr()
before fread()ing again after an EINTR is returned on a previous
fread.

Proactive fix for facebook#6509
@riversand963
Copy link
Contributor

Thanks @ChinaXing for reporting. Would you be interested in contributing a fix for this to RocksDB master?

Phantomape added a commit to Phantomape/rocksdb that referenced this issue Mar 29, 2020
This change updates PosixSequentialFile::Read to call clearerr()
before fread()ing again after an EINTR is returned on a previous
fread.

The original fix is from cockroachdb@bd8f1eb.
Fixing facebook#6509

Signed-off-by: phantomape <[email protected]>
facebook-github-bot pushed a commit that referenced this issue Mar 30, 2020
Summary:
This change updates PosixSequentialFile::Read to call clearerr()
before fread()ing again after an EINTR is returned on a previous
fread.

The original fix is from cockroachdb@bd8f1eb.
Fixing #6509

Signed-off-by: phantomape <[email protected]>
Pull Request resolved: #6609

Reviewed By: zhichao-cao

Differential Revision: D20731482

Pulled By: riversand963

fbshipit-source-id: 7f1f3a1449077d5560f45c465a78d08633740ba0
@riversand963
Copy link
Contributor

Given #6609 is merged, I am closing this. Thanks @ChinaXing !

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

No branches or pull requests

2 participants