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

ConnectionListener's closed not invoked when connection is lost #98

Open
mnlipp opened this issue May 5, 2023 · 0 comments
Open

ConnectionListener's closed not invoked when connection is lost #98

mnlipp opened this issue May 5, 2023 · 0 comments

Comments

@mnlipp
Copy link
Contributor

mnlipp commented May 5, 2023

When the IMAP server closes a connection while the IdleManager is waiting (watching), the ConnectionListener's closed is not invoked.

Here's a stack trace from this condition:

DEBUG IMAP: IdleManager got exception for folder: imap://xxxxxxxx/INBOX, THROW: 
jakarta.mail.FolderClosedException: * BYE Jakarta Mail Exception: java.net.SocketException: Connection reset
	at org.eclipse.angus.mail.imap.IMAPFolder.handleIdle(IMAPFolder.java:3309)
	at org.eclipse.angus.mail.imap.IdleManager.processKeys(IdleManager.java:351)
	at org.eclipse.angus.mail.imap.IdleManager.select(IdleManager.java:262)
	at org.eclipse.angus.mail.imap.IdleManager.access$200(IdleManager.java:111)
	at org.eclipse.angus.mail.imap.IdleManager$1.run(IdleManager.java:140)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)

Going through the code, there's nothing that invokes the listeners.

To Reproduce
Steps to reproduce the behavior:

  1. Setup IMAP server that closes connections after some idle time
  2. Open folder
  3. Add ConnectionListener to the folder
  4. IdleManager.watch folder

Expected behavior
The closed method of all ConnectionListeners added to the folder should be invoked.

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

No branches or pull requests

1 participant