eclipse-ee4j / eclipse-ee4j/angus-mail

FolderClosedException not propagated in IdleManager, no event fired

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
87
Forks
23
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
I see the follow log:

```
DEBUG IMAP: IdleManager waiting...
DEBUG IMAP: IdleManager selected 1 channels
DEBUG IMAP: IdleManager selected folder: imaps://email%40inetsoftware.de@mail.inetsoftware.de/INBOX
* BYE Server shutting down.
DEBUG IMAP: handleIdle: set to RUNNING
DEBUG IMAP: IdleManager got exception for folder: imaps://email%40inetsoftware.de@mail.inetsoftware.de/INBOX, THROW:
jakarta.mail.FolderClosedException: * BYE Server shutting down.
at org.eclipse.angus.mail.imap.IMAPFolder.handleIdle(IMAPFolder.java:3324)
at org.eclipse.angus.mail.imap.IdleManager.processKeys(IdleManager.java:358)
at org.eclipse.angus.mail.imap.IdleManager.select(IdleManager.java:269)
at org.eclipse.angus.mail.imap.IdleManager.access$200(IdleManager.java:118)
at org.eclipse.angus.mail.imap.IdleManager$1.run(IdleManager.java:147)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
```

I have registered listener on store and folder:

```
ConnectionListener listener = new ConnectionListener() {
@Override
public void opened( ConnectionEvent e ) {
}
@Override
public void disconnected( ConnectionEvent e ) {
LOGGER.debug ( "Disconnected: " + folder );
}
@Override
public void closed( ConnectionEvent e ) {
LOGGER.debug ( "Closed: " + folder );
}
};
store.addConnectionListener( listener );
folder.addConnectionListener( listener );
```

But I get no ConnectionEvent that I can handle correct the broken connection. Also IdleManager.watch() does not throw any exception.

Contributor guide

Open the contributing guide

Research direction

Start by tracing IMAPFolder.handleIdle and IdleManager.processKeys/select, then inspect IdleManager.watch() and the registered ConnectionListener behavior. Reproduce the server-shutdown path and verify that FolderClosedException results in the appropriate connection event and that watch() exposes the failure as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.