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

Vertx MailClient 'createShared' is broken as of 3.x (3.9?). #171

Open
ravindrahv opened this issue Nov 1, 2021 · 1 comment
Open

Vertx MailClient 'createShared' is broken as of 3.x (3.9?). #171

ravindrahv opened this issue Nov 1, 2021 · 1 comment
Labels

Comments

@ravindrahv
Copy link

Questions

Hello,

It has been observed that the 'createShared' implementation of Vertx is broken - in that the client tends to mix-up (interleave) the SMTP commands - MAIL FROM / RCPT TO / DATA sections (with regard to the RFC) under shared socket scenarios.

Version

Which version(s) did you encounter this bug ?

3.x (Exact version is not known. Likely its 3.9. However, believe this should be reproducible in current versions - that is 4.x variants as well)

Need to look at - https://github.com/vert-x3/vertx-mail-client/blob/3.9/src/main/java/io/vertx/ext/mail/MailClient.java

Context

In particular it has been observed that a mail intended to be initiated from '[email protected]' to '[email protected]' was instead delivered to '[email protected]' (likely owing to the fact that one thread sent 'MAIL FROM' and 'RCPT TO' where as 'DATA' part was sent from another thread).

Do you have a reproducer?

Not as of now but the issue was clearly visible at around 30 Requests-Per-Second Approx.

  • Link to github project/gist

Steps to reproduce

Server-End

  1. Set up a mail server in relay configuration to enqueue emails (source, destination, content) but not to deliver.

Client-End

  1. Prepare a test case such that there is a specific set of senders and receivers and the payload that can be reviewed for discrepancies. Create about a hundred of these.
  2. Initiate a load of around 30 RPS using a suitable test harness. A single system as client and a single system as a server should do the trick but more would be better ! Initiate a load for about 15 minutes.
  3. Review the contents in the mail-server logs/queue. There would at least be a handful of discrepancies (where the intended combination of source and destination is different).

Extra

  • OS - Ubuntu 18 or 20 ?
  • JVM - JDK 1.8 ?
@gaol
Copy link
Member

gaol commented Nov 3, 2021

Once one SMTP connection is retrieved from the connection pool, it is supposed explicitly to be used for sending one email message. The connection will be either closed or return back to pool for next reuse only after current email transaction completes, even it may switch to another thread for some reason.

I think the problem maybe connection pool implementation in 3.9, somehow, the connection was used by another mail transaction. vertx-mail-client uses new connection pool implementation from 4.1.0+, would you please give it a try ? thanks :)

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