[Pymilter] milter multiprocess (or multithread)

Stuart D. Gathman stuart at gathman.org
Tue Dec 10 09:54:00 EST 2019


On Tue, 10 Dec 2019, Marco wrote:

> I suppose there is no way to have a graceful shutdown with threading in 
> pymilter.

I don't think we've exhausted all solutions yet, but yeah, most likely.

> There is not a Milter.Milter stop(self) function to print something when 
> SIGTERM or other signal happens, and then stop :(

No, but it is wrapped in the low level milter module:
https://pymilter.org/pymilter/namespacemilter.html

import milter
...
# in some thread, perhaps responding to a magic HELO or management
# socket
milter.stop()
...

The C-API doc is here:
https://pymilter.org/pymilter/milter_api/smfi_stop.html

If I can remember so far back, I believe I was thinking, "This smfi_stop
is pretty low level.  I'll wrap it in C module, but not in the
high level Milter.Base."

-- 
 	      Stuart D. Gathman <stuart at gathman.org>
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.


More information about the Pymilter mailing list