You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reclaimFilePageCache doesn't set errno. As a consequence the logged error will be whatever errno was set to prior to the call.
To reproduce
Set errno = EAGAIN.
Make sure rdbSaveInternal is called with arguments that makes reclaimFilePageCache fail.
Watch the log. It will say: Unable to reclaim cache after saving RDB: Resource temporarily unavailable which is not the reason why the internal posix_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 set errno but return the error instead. If memory serves me right, it's because these functions came into existence before C11 (where errno was made _Thread_local) so setting and checking errno from different threads wasn't thread safe.
The text was updated successfully, but these errors were encountered:
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.
Fixesredis#13245
Signed-off-by: Ted Lyngmo <ted@lyncon.se>
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: