knadh / smtppool Goto Github PK
View Code? Open in Web Editor NEWHigh throughput Go SMTP pool library with graceful handling of idle timeouts, errors, and retries.
License: MIT License
High throughput Go SMTP pool library with graceful handling of idle timeouts, errors, and retries.
License: MIT License
This ticket is related to the following listmonk issue. I am currently investigating the file pool.go. I suspect there may be a deadlock preventing unresponsive connections from being removed from the pool, and that as a result after dying one by one (because the SMTP Server is overloaded and cannot send messages fast enough) all the connections in the pool are actually dead ones.
This is the only way I can explain the behavior since looking at the source code, if connections were removed from the pool, a new connection would be created (which I know does not happen since the SMTP Server no longer receives any incoming connection). So far my investigations have not led me to an obvious suspect but I feel the solution lies somewhere in this file.
I will also look into whether or not there are differences with the way Linux and FreeBSD and handle locks that may lead to deadlocks in FreeBSD that wouldn't occur on Linux.
Sometimes, when there is a lot of sending going on I get a "503 Sender already specified" from pool.Send() when the pool has been instantiated with
pool, err := smtppool.New(smtppool.Opt{
Host: os.Getenv("SMTP_HOST"),
Port: 587,
MaxConns: 10,
IdleTimeout: time.Second * 10,
PoolWaitTimeout: time.Second * 3,
Auth: smtp.PlainAuth("",
os.Getenv("SMTP_USERNAME"),
os.Getenv("SMTP_PASSWORD"),
os.Getenv("SMTP_HOST")),
TLSConfig: &tls.Config{ServerName: os.Getenv("SMTP_HOST")},
})
There seems to be some race condition going on possibly where a connection gets used by a different send request and I wonder if this explains also knadh/listmonk#300 (although I am not using listmonk, only smtppool).
I only send to only one address, but there are many send requests coming in in parallel sometimes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.