jakartaee / jakartaee/mail-api
New API to cancel a running long imap request
- Dominant language
- Java
- Stars
- 285
- Forks
- 109
- Avg merge
- 15h 19m
- Merged PRs (30d)
- 1
Description
**Description of the problem**
When a long operation is running on a folder (e.g. search/sort of 100.000 or more msgs with a message body pattern term), I may want to cancel that operation before it's finished.
I don't think that a "close" or "forceClose" would do the job.
What happens is that if the user (using the GUI) is canceling the search, the code instructs the search thread to cancel everything asap, but that asap will be actually "when the imap server will answer", and this may be many minutes, time when the CPU may be working hard searching for nothing, and the same user may issue another search to try again, driving mad the CPU.
**Describe the solution you'd like**
If not still available, some API call on folder to let it cancel any running protocol operation.
**Describe alternatives you've considered**
Using close would probably hang until end of operations, using forceClose would return but probably not stop the imap operation stealing cpu cycles.
Contributor guide
Research direction
Start by reviewing the folder API and the existing close and forceClose operations, then trace how long IMAP search or sort requests are cancelled. Define what a cancellation API must do for a running protocol operation and how it differs from closing the folder; done means the API behavior is specified and covered for the described GUI cancellation case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100