PennMUSH Community

Ticket #7348 (closed bug: fixed)

Opened 1 year ago

Last modified 1 year ago

info_slave doesn't terminate on mush crash

Reported by: anonymous Assigned to: raevnos
Priority: minor Milestone: 1.8.3p3
Keywords: Cc:
Visibility: Public

Description

When M*U*S*H crashes, it looks like info_slave, which now uses
unix sockets, doesn't terminate/die like it used to. As a result,
you can't autorestart the mush because port 4201 is still being
bound by the lingering info_slave.

This seems bad.

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Javelin@M*U*S*H, once Paul@DuneMUSH | Alan Schwartz <dunemush@pennmush.org>
   (mush.pennmush.org 4201)         |     
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Change History

(in reply to: ↑ description ) 06/03/07 12:29:51 changed by raevnos

  • owner changed from devteam to raevnos.

Replying to Alan Schwartz <dunemush@pennmush.org>:

{{{ When M*U*S*H crashes, it looks like info_slave, which now uses unix sockets, doesn't terminate/die like it used to. As a result, you can't autorestart the mush because port 4201 is still being bound by the lingering info_slave. }}}

info_slave has used unix sockets instead of ip ones for years. It's just using datagrams instead of streams now. And, hmm... I can see how that might not cause a read error, even if the datagram socket is connected. I'll figure out a fix. Maybe wake up every few minutes and check to see if the mush's pid is still running.

However, when info_slave is started, almost all open file descriptors are explicitly closed (Except for stderr and the one used to talk to netmud.) See info_master.c:make_info_slave(). You thus shouldn't be getting errors about a port already in use because of an info_slave that is still running. I just checked with lsof, and the only things info_slave has open are libraries, netmush.log, and the socketpair pipe.

06/05/07 13:33:02 changed by raevnos

  • type changed from incoming to bug.
  • milestone set to 1.8.3p3.

Okay, got a fix. But right now it only works on BSD systems with the kqueue()/kevent() polling interface (Which lets you wait for events as diverse as data waiting to be read from a socket and a process exiting). I'll whip up something using select() and period checks to see if a process exists for OSes without it, then commit.

06/05/07 22:01:19 changed by raevnos

  • status changed from new to closed.
  • resolution set to fixed.