nithril / smtp-connection-pool

SMTP Connection Pool
Apache License 2.0
47 stars 19 forks source link

New pull request proposal - Set expiry time for smtp connections #17

Closed gopi-gith closed 6 years ago

gopi-gith commented 6 years ago

SMTP Servers does not like when clients hang on to connections for very long time. They force clients to disconnect if the connection is held more than allowed amount of time.

In order to solve this problem, we extended the library to invalidate connections after a specified amount of time elapses.

If this feature is helpful for others, we can submit a pull request with implementation and tests.

nithril commented 6 years ago

Could you please elaborate how your proposal is different from the DefaultEvictionPolicy ?

gopi-gith commented 6 years ago

The DefaultEvictionPolicy seems to be based on idle time of a connection. What we would like to have is based on active time of a connection. Lets say if the SMTP Server does not allow connections to be open for more than 5 minutes, then we want to evict all connections in pool that are active for more than 5 minutes.

nithril commented 6 years ago

Thanks for the clarification, could you please submit the PR?

gopi-gith commented 6 years ago

on further investigation we found that this is one of the temporary hiccups in our infrastructure. we are not able to replicate the problem consistently. I'll investigate this further and get back to you with more information of the issue as well as the fix. please close this issue for now.