sysrepo FEATURE recovery refactored
Excluding cases when a mutex was left
locked.
@@ -268,6 +268,12 @@ sr_shmmain_conn_check(sr_cid_t cid, int *conn_alive, pid_t *pid)
if (pid) {
*pid = 0;
}
+
+ /* print message and delete the file on first detection */
+ SR_LOG_WRN("Connection with CID %" PRIu32 " is dead.", cid);
+ if (unlink(path) == -1) {
+ SR_ERRINFO_SYSERRNO(&err_info, "unlink");
+ }
} else {
/* we cannot get the lock, it must be held by a live connection */
*conn_alive = 1;
