[mapguide-internals] Dangling sockets on un-graceful mgserver shutdown on Linux

Even Rouault even.rouault at spatialys.com
Thu Oct 2 07:57:03 PDT 2014


Le jeudi 02 octobre 2014 14:07:11, Jackie Ng a écrit :
> Hi All,
> 
> I've been noticing that whenever mgserver ungracefully shuts down whether
> by segfault or by being killed off by kill/killall, the TCP/IP ports
> opened by MapGuide will not be properly released. Attempting to restart
> mgserver will generally fail due to the ports being in use.
> 
> The ports will eventually be available after waiting a few minutes after
> the un-graceful mgserver shutdown. Is there a way that mgserver can listen
> for SIGSEGV and/or SIGKILL (presumably the signals that are raised when
> such events happen) and perform any necessary socket clean up before
> bailing?

I don't think so. You cannot really do anything useful and reliable in signal 
handlers

However http://stackoverflow.com/questions/6380057/python-binding-socket-
address-already-in-use might help. Basically you can try setting the socket 
option SO_REUSEADDR before binding.

Even

> 
> - Jackie
> 
> 
> 
> --
> View this message in context:
> http://osgeo-org.1560.x6.nabble.com/Dangling-sockets-on-un-graceful-mgserv
> er-shutdown-on-Linux-tp5165499.html Sent from the MapGuide Internals
> mailing list archive at Nabble.com.
> _______________________________________________
> mapguide-internals mailing list
> mapguide-internals at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-internals

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the mapguide-internals mailing list