[ 
https://issues.apache.org/jira/browse/JAMES-3709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17481700#comment-17481700
 ] 

Karsten Otto edited comment on JAMES-3709 at 1/25/22, 10:02 AM:
----------------------------------------------------------------

Unfortunately not, my colleague was doing the load testing. I recall that we 
saw in cassandra that there were still entries for a message in Cassandra 
imapuidtable and pop3metadata, but the message itself was gone from messagev3. 
Thus the TopCmdHandler got past MessageMetaDataUtils.getMetaData(), but then 
got null from Mailbox.getMessage(), did not check for it (as RetrCmdHandler 
does), and we got the NPE during transfer.

So this refactoring will fix a symptom but not he cause. I believe my colleague 
is doing more test and might ask questions or create a separate bug ticket.


was (Author: kotto):
Unfortunately not, my colleague was doing the load testing. I recall that we 
saw in cassandra that there were still entries for a message in Cassandra 
imapuidtable and pop3metadata, but the message itself was gone from messagev3. 
Thus the TopCmdHandler got past MessageMetaDataUtils.getMetaData(), but then 
got null from Mailbox.getMessage(), did not check for it (as RetrCmdHandler 
does), and we got the NPE during transfer.

> Missing null check in POP3 TopCmdHandler
> ----------------------------------------
>
>                 Key: JAMES-3709
>                 URL: https://issues.apache.org/jira/browse/JAMES-3709
>             Project: James Server
>          Issue Type: Bug
>          Components: protocols
>    Affects Versions: master
>            Reporter: Karsten Otto
>            Priority: Major
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> TopCmdHandler is missing a null check when retrieving the message content, 
> i.e. the InputStream can be null, which results in an NPE down the line. 
> Admittedly this is a rare case, I only observed this during heavy load 
> testing.
> On closer inspection it turns out that TopCmdHandler duplicates a major 
> portion of code from RetrCmdHandler, but with subtle differences such as the 
> null check mentioned above.
> I propose to refactor the two classes to make them share the code, and 
> provide unit tests for all possible error/success cases.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to