Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The connection is NOT dropped after keepAliveTimeout #222

Open
wintergow opened this issue Jul 3, 2024 · 1 comment
Open

The connection is NOT dropped after keepAliveTimeout #222

wintergow opened this issue Jul 3, 2024 · 1 comment
Labels

Comments

@wintergow
Copy link

wintergow commented Jul 3, 2024

Questions

We are facing the issue that our SMTP server drop the connection if the connection elapsed time more than 10 minute no matter the connection is idle or busy. I have checked keepAliveTimeout to be 300 sec by default. But it seems it cannot be killed after 300 sec sometime then it has been dropped by the SMTP server when sending the email.

Version

4.5.7

Context

To simulate the issue, I have set the config as below:
maxPoolSize = 1
keepAlive = true
keepAliveTimeout = 300
keepAliveTimeoutUnit = TimeUnit.SECONDS
poolCleanerPeriod = 1000
poolCleanerPeriodUnit = TimeUnit.MILLISECONDS
Change the log level to TRACE
Chang the maximum connection time to 30 minute in SMTP server.

09:39:37: 1st email send request is triggered. Then the connection is recycled with the log: "TRACE i.vertx.ext.mail.iml.SMTPConnection -recycle for next use"
09:40:38: 2nd email send request is triggered. Then the connection is recycled with the log: "TRACE i.vertx.ext.mail.iml.SMTPConnection -recycle for next use"
09:53:23: 3rd email send request is triggered. Then the connection is recycled with the log: "TRACE i.vertx.ext.mail.iml.SMTPConnection -recycle for next use"
09:55:06: 4th email send request is triggered. Then the connection is recycled with the log: "TRACE i.vertx.ext.mail.iml.SMTPConnection -recycle for next use"
10:00:07: The connection is dropped with the log: "DEBUG i.vertx.ext.mail.impl.SMTPConnection - QUIT"

You can see the connection is not dropped between 09:40:38 and 09:53:23. But the connection is dropped 5 min after 4th email request sent.

It seems the keepAliveTimeout is NOT always working.

Do you have a reproducer?

No

@wintergow wintergow added the bug label Jul 3, 2024
@gaol
Copy link
Member

gaol commented Oct 30, 2024

@wintergow From the logs I see:

  • The connection got dropped after 5 minutes after the 4th mail, so it is expected behavior.
  • The connection did not get dropped after 2nd mail, before 3rd mail, which is the suspicions here, one possibility is that the sending of the 2nd email takes long time somehow(big email body, high network latency, etc). During the data transmit, the connection is out of the pool and is active, so we don't close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants