vert-x3 / issues

Apache License 2.0
36 stars 7 forks source link

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

Closed ravindrahv closed 2 years ago

ravindrahv commented 2 years ago

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 'sender-one@sender-one.example.org' to 'recipient-one@recipient.example.com' was instead delivered to 'recipient-two@recipient-two.example.org' (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.

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

ravindrahv commented 2 years ago

Created issue under vertx-mail-client ! https://github.com/vert-x3/vertx-mail-client/issues/171