aio-libs / aio-libs/aiosmtpd

Entire python process stalls when receiving multiple large inbound emails

Aperta
#293 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
373
Fork
105
Merge medio
4m
PR unite (30g)
2

Descrizione

I'd rate this as a critical bug, unless a workaround has already been found (didn't see anything in my reading of the docs),

My `asyncio` process instantiates a `Controller`, then starts it. In the separate thread started by the `Controller` object, `aiosmtpd` opens an inbound port and listens for sessions. So far so good, all pretty normal.

But at times when multiple external clients are simultaneously injecting large-ish (>5MB) messages, the entire python process -- all event loops, all threads -- grinds to a complete halt.

My tests have been to get an external machine to simultaneously inject 10 messages, of 20MB each, into my SMTPD port. I provide my `Controller` object with a null stub `handle_DATA()` hook, which simply returns `"250 Accepted"`.

Every time I run this test, the entire process freezes for between 10.5 and 18 seconds, until the injections are complete.

I'm guessing this is a GIL issue. My "main" thread and `asyncio` event loop freezes, along with everything running within that process.

I'm considering a radical option of spawning a separate `aiosmtpd`-based subprocess, and having its `handle_DATA()` hook throw the received envelopes into a pipeline, where they get pickled then base64'ed and passed via subproc stdout to the parent process.

I truly hope there's a better way. Can anyone please advise a more satisfactory remedy or workaround?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.