You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/05/12 11:21:24 UTC

[GitHub] [ignite] DirectXceriD opened a new pull request #9094: IGNITE-14248 Handle exceptions in PartitionReservationManager.onDoneA…

DirectXceriD opened a new pull request #9094:
URL: https://github.com/apache/ignite/pull/9094


   …fterTopologyUnlock properly
   
   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


-- 
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:
users@infra.apache.org



[GitHub] [ignite] asfgit closed pull request #9094: IGNITE-14248 Handle exceptions in PartitionReservationManager.onDoneA…

Posted by GitBox <gi...@apache.org>.
asfgit closed pull request #9094:
URL: https://github.com/apache/ignite/pull/9094


   


-- 
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:
users@infra.apache.org



[GitHub] [ignite] sk0x50 commented on a change in pull request #9094: IGNITE-14248 Handle exceptions in PartitionReservationManager.onDoneA…

Posted by GitBox <gi...@apache.org>.
sk0x50 commented on a change in pull request #9094:
URL: https://github.com/apache/ignite/pull/9094#discussion_r642595352



##########
File path: modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/PartitionReservationManager.java
##########
@@ -351,7 +353,8 @@ private static void failQueryOnLostData(GridCacheContext cctx, GridDhtLocalParti
                 GridIoPolicy.MANAGEMENT_POOL);
         }
         catch (Throwable e) {
-            log.error("Unexpected exception on start reservations cleanup", e);
+            log.error("Unexpected exception on start reservations cleanup");

Review comment:
       Please add a dot at the end of the sentence. :)

##########
File path: modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ReservationsOnDoneAfterTopologyUnlockFailTest.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.Arrays;
+import java.util.concurrent.ExecutorService;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.failure.FailureType;
+import org.apache.ignite.failure.TestFailureHandler;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.spy;
+
+/**
+ *
+ */
+public class ReservationsOnDoneAfterTopologyUnlockFailTest extends GridCommonAbstractTest {
+
+    /**
+     * @throws Exception If failed.
+     */
+    @Test
+    public void testFailureHandlerTriggeredOnTopologyUnlockError() throws Exception {
+        TestFailureHandler hnd = new TestFailureHandler(false);
+
+        IgniteEx grid0 = startGrid(getConfiguration(testNodeName(0))
+                .setFailureHandler(hnd));
+
+        ExecutorService mockMgmtExecSvc = spy(grid0.context().getManagementExecutorService());
+        doAnswer(invocationOnMock -> {
+            Arrays.stream(Thread.currentThread().getStackTrace())
+                    .map(StackTraceElement::getMethodName)
+                    .filter("onDoneAfterTopologyUnlock"::equals)
+                    .findAny()
+                    .ifPresent(m -> {
+                        throw new OutOfMemoryError();
+                    });
+            return invocationOnMock.callRealMethod();
+        }).when(mockMgmtExecSvc).execute(any(Runnable.class));
+
+        GridTestUtils.setFieldValue(grid(0).context(), "mgmtExecSvc", mockMgmtExecSvc);
+
+        grid0.getOrCreateCache(new CacheConfiguration<>()
+                .setName(DEFAULT_CACHE_NAME))
+                .put(1, 1);
+
+        startGrid(getConfiguration(testNodeName(1))
+                .setFailureHandler(hnd));
+
+        hnd.awaitFailure(3000);
+
+        assertNotNull(hnd.failureContext());

Review comment:
       It would be nice to add a human-readable message.

##########
File path: modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/ReservationsOnDoneAfterTopologyUnlockFailTest.java
##########
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import java.util.Arrays;
+import java.util.concurrent.ExecutorService;
+import org.apache.ignite.configuration.CacheConfiguration;
+import org.apache.ignite.failure.FailureType;
+import org.apache.ignite.failure.TestFailureHandler;
+import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.testframework.GridTestUtils;
+import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
+import org.junit.Test;
+
+import static org.mockito.Mockito.any;
+import static org.mockito.Mockito.doAnswer;
+import static org.mockito.Mockito.spy;
+
+/**
+ *
+ */
+public class ReservationsOnDoneAfterTopologyUnlockFailTest extends GridCommonAbstractTest {
+

Review comment:
       Please remove empty line.




-- 
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:
users@infra.apache.org