In branch "else if (!bysignal && exitcode != 0)" in line 1789 of aof.c, it seems that bysignal can only be something like 0 to pass the check. However, the subsequent logic has "if (bysignal != SIGUSR1)" included, which always evalute to false.
else if (!bysignal && exitcode != 0) {
/* SIGUSR1 is whitelisted, so we have a way to kill a child without
* tirggering an error condition. */
if (bysignal != SIGUSR1)
server.aof_lastbgrewrite_status = C_ERR;
serverLog(LL_WARNING,
"Background AOF rewrite terminated with error");
} else {
server.aof_lastbgrewrite_status = C_ERR;
serverLog(LL_WARNING,
"Background AOF rewrite terminated by signal %d", bysignal);
}
Comment From: MEDSMEDS
already fixed by @patpatbear. thanks