[ 
https://issues.apache.org/jira/browse/ARTEMIS-4319?focusedWorklogId=866794&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-866794
 ]

ASF GitHub Bot logged work on ARTEMIS-4319:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 21/Jun/23 16:13
            Start Date: 21/Jun/23 16:13
    Worklog Time Spent: 10m 
      Work Description: jbertram commented on code in PR #4512:
URL: https://github.com/apache/activemq-artemis/pull/4512#discussion_r1237260437


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServerLogger.java:
##########
@@ -1573,13 +1573,13 @@ void slowConsumerDetected(String sessionID,
    @LogMessage(id = 224122, value = "Address {} number of messages is under 
page limit again, and it should be allowed to page again.", level = 
LogMessage.Level.INFO)
    void pageFree(SimpleString address);
 
-   @LogMessage(id = 224123, value = "Address {} has more pages than allowed. 
System currently has {} pages, while the estimated max number of pages is {}, 
based on the limitPageBytes ({}) / page-size ({})", level = 
LogMessage.Level.WARN)
-   void pageFullMaxBytes(SimpleString address, long pages, long maxPages, long 
limitBytes, long bytes);
+   @LogMessage(id = 224123, value = "Address {} has more pages than allowed. 
System currently has {} pages, while the estimated max number of pages is {} 
based on the page-limit-bytes ({}) / page-size ({})", level = 
LogMessage.Level.WARN)
+   void pageFullMaxBytes(SimpleString address, long pages, Long maxPages, Long 
limitBytes, int bytes);

Review Comment:
   I'm not entirely sure how this gets logged when the limit is `null`. This is 
what was reported by a user on the [mailing 
list](https://lists.apache.org/thread/j9v7j6w0hff0sbmhn7qyzy79cj54ohhv):
   
   > My hunch is that once we set a limit, we cannot remove the section 
completely, so set a very low `<page-limit-bytes>` and start the broker, let 
the address start paging and then remove the `<page-limit-bytes>` completely 
from address setting.
   
   It looks like there may be other, larger issues present, but I wanted to 
mitigate the NPE before going deeper.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 866794)
    Time Spent: 0.5h  (was: 20m)

> Mitigate NPE in paging log statement
> ------------------------------------
>
>                 Key: ARTEMIS-4319
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-4319
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> From the user's mailing list:
> {quote}
> ...when we remove the limit, as it was too less for our case, we got null 
> pointer exception in logs so we are currently forced to use less page limit. 
> Since the error here tries to convert to longValue...
> {noformat}
> [org.apache.activemq.artemis.core.server] AMQ222225: Sending unexpected 
> exception to the client java.lang.NullPointerException: Cannot invoke 
> "java.lang.Long.longValue()" because "this.pageLimitBytes" is null
>   at 
> org.apache.activemq.artemis.core.paging.impl.PagingStoreImpl.checkNumberOfPages(PagingStoreImpl.java:324)
>  ~[artemis-server-2.28.0.jar:2.28.0]{noformat}{quote}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to