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
[BUG] Wrong error logged when reclaimFilePageCache
fails
#13245
Comments
TedLyngmo
added a commit
to TedLyngmo/redis
that referenced
this issue
May 3, 2024
`reclaimFilePageCache` did not set `errno` but `rdbSaveInternal` which is logging the error assumed it did. This makes sure `errno` is set. Fixes redis#13245 Signed-off-by: Ted Lyngmo <[email protected]>
sundb
pushed a commit
that referenced
this issue
May 21, 2024
`reclaimFilePageCache` did not set `errno` but `rdbSaveInternal` which is logging the error assumed it did. This makes sure `errno` is set. Fixes #13245 Signed-off-by: Ted Lyngmo <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
reclaimFilePageCache
doesn't seterrno
. As a consequence the logged error will be whatevererrno
was set to prior to the call.To reproduce
errno = EAGAIN
.rdbSaveInternal
is called with arguments that makesreclaimFilePageCache
fail.Unable to reclaim cache after saving RDB: Resource temporarily unavailable
which is not the reason why the internalposix_fadvise
failed.Expected behavior
I'm expecting the
serverLog(LL_NOTICE,"Unable to reclaim cache after saving RDB: %s", strerror(errno));
line to print the real cause for the failure.Additional information
posix_*
functions don't seterrno
but return the error instead. If memory serves me right, it's because these functions came into existence before C11 (whereerrno
was made_Thread_local
) so setting and checkingerrno
from different threads wasn't thread safe.The text was updated successfully, but these errors were encountered: