Skip to content
Snippets Groups Projects
Commit 229cca91 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Close node socket after waiting one hour to go inactive to run exclusive event

After 90 minutes of waiting, we'll do the same abort wait (and run the event
anyway), but closing the node's socket should be enough to get the node_thread
to terminate and set the node status back to NODE_WFC.

Apparently some sysops like to leave their terminals idling (e.g. running MRC)
and never disconnect and since they're T-exempt, the BBS won't limit their
time online to allow events to run. Exclusive events will wait for all nodes
to become inactive, but give up after 90 minutes of waiting and run the event
anyway and set node status to WFC at the end. If the node was actually still
connected/in-use, this could lead to the (new) critical error messages logged
"!Node X status is WFC, but the node socket (N) and thread are still in use!"
and other chaos (NODE STATUS FIXUP and the like).

This should prevent all that by just abruptly disconnecting the node after
waiting 60 minutes for the sysop to gracefully disconnect. The log message
when this happens:
"!TIRED of waiting for node N to become inactive (status=X), closing socket Y"
parent fa5877aa
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #4753 passed
...@@ -3198,8 +3198,14 @@ void event_thread(void* arg) ...@@ -3198,8 +3198,14 @@ void event_thread(void* arg)
break; break;
sbbs->lprintf(LOG_DEBUG,"Waiting for node %d (status=%d)" sbbs->lprintf(LOG_DEBUG,"Waiting for node %d (status=%d)"
,j, node.status); ,j, node.status);
if (now - start > (60 * 60) && node_socket[j - 1] != INVALID_SOCKET) {
sbbs->lprintf(LOG_WARNING, "!TIRED of waiting for node %d to become inactive (status=%d), closing socket %d"
,j, node.status, node_socket[j - 1]);
close_socket(node_socket[j - 1]);
node_socket[j - 1] = INVALID_SOCKET;
}
if(now-start>(90*60)) { if(now-start>(90*60)) {
sbbs->lprintf(LOG_WARNING,"!TIMEOUT waiting for node %d to become inactive (status=%d)" sbbs->lprintf(LOG_WARNING,"!TIMEOUT waiting for node %d to become inactive (status=%d), aborting wait"
,j, node.status); ,j, node.status);
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment