Opened 3 days ago

#448 new defect

mlsys_mailer_unspool.pl1 uses too much of its time trying to connect to an unreachable host

Reported by: Jim Lippard Owned by: Eric Swenson
Priority: major Milestone: MR12.10
Component: Networking Version: MR12.9
Keywords: mlsys, networking, mlsys_mailer_unspool.pl1 Cc:

Description

While trying to test email over Chaosnet but having issues with my connection, I observed my CPU spin up for minutes at a time, with this appearing in nslog roughly every ten minutes:

10:36:24 mlsys_mailer_unspool: Beginning pass of mailer queues.
10:41:47 mlsys_mailer_unspool: Setting GHM.SWENSON.ORG down.
10:41:47 mlsys_mailer_unspool: Finished pass of mailer queues.
10:46:47 mlsys_mailer_unspool: Beginning pass of mailer queues.
10:52:10 mlsys_mailer_unspool: Setting GHM.SWENSON.ORG down.
10:52:10 mlsys_mailer_unspool: Finished pass of mailer queues.

(1) The existing code detects down hosts, but discards the list of down hosts at the start of every pass (line 268, call check_host_$reset). Instead, there should be a time interval to the next check that is made longer after each successive failure, and reset to the minimum after the host is live again. The interval and the per-host state belong in check_host_, which may need a new entry point: this program currently use $check, $dead and $reset. Resetting the interval to the minimum when a host comes back requires something that reports a host live.

(2) check_host_$dead is called only from the some_not_sent branch (lines 384–387). An entry whose recipients have all been delivered or have fatal errors takes the delete_message branch (line 390) instead and never marks the host down. The next entry in the same pass makes another full connection attempt to a host that has just failed. One pass holding two such entries took 648 seconds. The host should be marked down on a transport failure here as well, but not on a delivery failure such as a 550, which says nothing about whether the host is reachable.

Log evidence:
07:09:15 mlsys_mailer_unspool: Beginning pass of mailer queues.
07:14:41 mlsys_mailer_unspool: The operation was not completed within the required time. Mailing from Lippard...
07:20:03 mlsys_mailer_unspool: Setting GHM.SWENSON.ORG down.
07:20:03 mlsys_mailer_unspool: Finished pass of mailer queues.

(3) An AIM violation stops all queued messages from being delivered until removed by hand, same pattern as a previously fixed bug (change 5 in the history comments). The return at line 316 also abandons the queue entry (allocated at 278) and the message text (287) without freeing either, and leaves msx and mmsx open. (Lines 310-316.)

(4) cleanup is declared but there's no cleanup handler. A cleanup handler should be established to cleanup allocated storage and close msx and mmsx.

(5) Lines 400-401 test new_ptr and assign it null, but it is never used anywhere.

(6) The error: exit closes msx but not mmsx (opened at line 143). (Lines 410-414)

Note: When my CPU spun up I also saw an apparent hang that didn't end until I logged out Network_Server, and none of the above was the cause of that.

Change History (0)

Note: See TracTickets for help on using tickets.