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

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

                Author: ASF GitHub Bot
            Created on: 20/May/21 20:24
            Start Date: 20/May/21 20:24
    Worklog Time Spent: 10m 
      Work Description: gtully commented on pull request #3592:
URL: https://github.com/apache/activemq-artemis/pull/3592#issuecomment-845452491


   the diff looks awful, but with white space ignored it is more trivial:
   ```
   git show -w
   commit 821f64c224a38050d7bbb5137cdc92048358c605 (HEAD -> main, 
gtully/ARTEMIS-3311)
   Author: gtully <[email protected]>
   Date:   Thu May 20 21:03:01 2021 +0100
   
       ARTEMIS-3311 - ensure visibility of error state on operation context 
callback registration, fix and test
   
   diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java
   index 37ef1c06d1..626f467750 100644
   --- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java
   +++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java
   @@ -130,14 +130,10 @@ public class OperationContextImpl implements 
OperationContext {
    
       @Override
       public void executeOnCompletion(final IOCallback completion, final 
boolean storeOnly) {
   -      if (errorCode != -1) {
   -         completion.onError(errorCode, errorMessage);
   -         return;
   -      }
   -
          boolean executeNow = false;
    
          synchronized (this) {
   +         if (errorCode == -1) {
                final int UNDEFINED = Integer.MIN_VALUE;
                int storeLined = UNDEFINED;
                int pageLined = UNDEFINED;
   @@ -184,9 +180,12 @@ public class OperationContextImpl implements 
OperationContext {
                   }
                }
             }
   +      }
    
   -      if (executeNow) {
          // Executing outside of any locks
   +      if (errorCode != -1) {
   +         completion.onError(errorCode, errorMessage);
   +      } else if (executeNow) {
             completion.done();
          }
    
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


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

    Worklog Id:     (was: 600022)
    Time Spent: 20m  (was: 10m)

> potential loss of error propagation to producer on failed paged message add
> ---------------------------------------------------------------------------
>
>                 Key: ARTEMIS-3311
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-3311
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.17.0
>            Reporter: Gary Tully
>            Assignee: Gary Tully
>            Priority: Major
>             Fix For: 2.18.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> The operation context is tracking the pending io and registering completion 
> handlers. The default page file timed sync can happen before the response 
> handler callback registration, flag an error, but that error may not be 
> visible to the calling thread. The response hander will not always get an 
> error in this case.
> the issue is visibility of the errorCode flag in operation context, it needs 
> to be checked in a synchronisation block to match how it is being set.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to