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

mail extension - socket was closed unexpected when shutting down the app #27918

Closed
rsvoboda opened this issue Sep 14, 2022 · 7 comments · Fixed by #28323
Closed

mail extension - socket was closed unexpected when shutting down the app #27918

rsvoboda opened this issue Sep 14, 2022 · 7 comments · Fixed by #28323
Labels
Milestone

Comments

@rsvoboda
Copy link
Member

Describe the bug

mail extension - socket was closed unexpectedwhen shutting down the app

2022-09-13 17:03:59,937 ERROR [io.ver.ext.mai.imp.SMTPConnection] (vert.x-eventloop-thread-0) socket was closed unexpected. [Error Occurred After Shutdown]
2022-09-13 17:03:59,938 ERROR [io.ver.ext.mai.imp.SMTPConnection] (vert.x-eventloop-thread-1) socket was closed unexpected. [Error Occurred After Shutdown]

Based on the discussion with @cescoffier

  • we keep a connection opened with the SMTP server
  • we are closing the connection, but the server didn't say BYE (yet)
  • so, we abruptly cut it (as we are shutting down)

AIs:

  • have a note in mailer reference guide
  • update the error message to mention that the remote server didn't reply when closing the connection

Expected behavior

More context in guide / error message.

Actual behavior

Not clear that the errors can occur.

How to Reproduce?

  • use mailer-quickstart
  • adjust application.properties and "To:" in MailResource.java
    • was using Gmail to send the emails
  • build the app - mvn clean package -DskipTests
  • run the app - java -jar target/quarkus-app/quarkus-run.jar
  • run curl localhost:8080/mail twice
  • hit Ctrl+C and check the logs

Output of uname -a or ver

macOS Monterey

Output of java -version

Java 17

GraalVM version (if different from Java)

No response

Quarkus version or git rev

Quarkus main

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@rsvoboda rsvoboda added the kind/bug Something isn't working label Sep 14, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 14, 2022

/cc @cescoffier

@rsvoboda rsvoboda changed the title mail extension - socket was closed unexpectedwhen shutting down the app mail extension - socket was closed unexpected when shutting down the app Sep 14, 2022
@gaol
Copy link
Contributor

gaol commented Sep 19, 2022

It relates to vert-x3/vertx-mail-client#185

@cescoffier
Copy link
Member

Thanks, @gaol, it's exactly that issue. Do you have an ETA?

@gaol
Copy link
Contributor

gaol commented Sep 19, 2022

@cescoffier these cases are inevitable IMO, when the connections are idle for a while, the SMTP server will close the connection, which will lead to this logging.

It does not break sending of emails, but it is a noisy message, so I proposed a fix of changing the log level back to debug like what it was in v3. vert-x3/vertx-mail-client#188

@cescoffier
Copy link
Member

Probably a good idea to reduce the level.

I can also filter out the message in our logging configuration.

@cescoffier
Copy link
Member

Issue fixed upstream.

@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 1, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.1.Final Oct 3, 2022
@rsvoboda
Copy link
Member Author

rsvoboda commented Oct 4, 2022

Thanks, tried the latest Quarkus main and the error message is no longer present when shutting down the app.

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

Successfully merging a pull request may close this issue.

4 participants