When a background RDB saving/transfer terminates, call the right handler. */
| 3650 | |
| 3651 | /* When a background RDB saving/transfer terminates, call the right handler. */ |
| 3652 | void backgroundSaveDoneHandler(int exitcode, bool fCancelled) { |
| 3653 | int type = g_pserver->rdb_child_type; |
| 3654 | switch(g_pserver->rdb_child_type) { |
| 3655 | case RDB_CHILD_TYPE_DISK: |
| 3656 | backgroundSaveDoneHandlerDisk(exitcode,fCancelled); |
| 3657 | break; |
| 3658 | case RDB_CHILD_TYPE_SOCKET: |
| 3659 | backgroundSaveDoneHandlerSocket(exitcode,fCancelled); |
| 3660 | break; |
| 3661 | default: |
| 3662 | serverPanic("Unknown RDB child type."); |
| 3663 | break; |
| 3664 | } |
| 3665 | |
| 3666 | g_pserver->rdbThreadVars.fRdbThreadActive = false; |
| 3667 | g_pserver->rdb_child_type = RDB_CHILD_TYPE_NONE; |
| 3668 | g_pserver->rdb_save_time_last = time(NULL)-g_pserver->rdb_save_time_start; |
| 3669 | g_pserver->rdb_save_time_start = -1; |
| 3670 | /* Possibly there are slaves waiting for a BGSAVE in order to be served |
| 3671 | * (the first stage of SYNC is a bulk transfer of dump.rdb) */ |
| 3672 | updateSlavesWaitingBgsave((!fCancelled && exitcode == 0) ? C_OK : C_ERR, type); |
| 3673 | } |
| 3674 | |
| 3675 | void unblockChildThreadIfNecessary() |
| 3676 | { |
no test coverage detected