You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2024/01/10 06:12:46 UTC

[PR] IGNITE-21226 NPE throws from MessageServiceImpl if service already stopped but incoming message still processed [ignite-3]

zstan opened a new pull request, #3026:
URL: https://github.com/apache/ignite-3/pull/3026

   …opped but incoming message still processed
   
   Thank you for submitting the pull request.
   
   To streamline the review process of the patch and ensure better code quality
   we ask both an author and a reviewer to verify the following:
   
   ### The Review Checklist
   - [ ] **Formal criteria:** TC status, codestyle, mandatory documentation. Also make sure to complete the following:  
   \- 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 description of the JIRA ticket explains WHAT was made, WHY and 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.
   - [ ] **Design:** new code conforms with the design principles of the components it is added to.
   - [ ] **Patch quality:** patch cannot be split into smaller pieces, its size must be reasonable.
   - [ ] **Code quality:** code is clean and readable, necessary developer documentation is added if needed.
   - [ ] **Tests code quality:** test set covers positive/negative scenarios, happy/edge cases. Tests are effective in terms of execution time and resources.
   
   ### Notes
   - [Apache Ignite Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Java+Code+Style+Guide)


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21226 NPE throws from MessageServiceImpl if service already stopped but incoming message still processed [ignite-3]

Posted by "zstan (via GitHub)" <gi...@apache.org>.
zstan merged PR #3026:
URL: https://github.com/apache/ignite-3/pull/3026


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21226 NPE throws from MessageServiceImpl if service already stopped but incoming message still processed [ignite-3]

Posted by "korlov42 (via GitHub)" <gi...@apache.org>.
korlov42 commented on code in PR #3026:
URL: https://github.com/apache/ignite-3/pull/3026#discussion_r1450175861


##########
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/framework/TestNode.java:
##########
@@ -75,8 +75,11 @@ public class TestNode implements LifecycleAware {
     private final PrepareService prepareService;
     private final ExecutionService executionService;
     private final ParserService parserService;
+    private final MessageService messageService;
 
     private final List<LifecycleAware> services = new ArrayList<>();
+    volatile boolean exceptionRaised;
+    IgniteSpinBusyLock holdLock;

Review Comment:
   `private final` ?



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21226 NPE throws from MessageServiceImpl if service already stopped but incoming message still processed [ignite-3]

Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #3026:
URL: https://github.com/apache/ignite-3/pull/3026#discussion_r1446941258


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/message/MessageServiceImpl.java:
##########
@@ -46,6 +46,8 @@ public class MessageServiceImpl implements MessageService {
 
     private volatile Map<Short, MessageListener> lsnrs;
 
+    private boolean stopped = false;

Review Comment:
   Shouldn't this field be `volatile`?



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/message/MessageServiceImpl.java:
##########
@@ -146,8 +154,18 @@ private void onMessageInternal(String consistentId, NetworkMessage msg) {
     /** {@inheritDoc} */
     @Override
     public void stop() {
-        if (lsnrs != null) {
-            lsnrs.clear();
+        if (!busyLock.enterBusy()) {
+            return;

Review Comment:
   `SqlQueryProcessor` blocks the busy lock before calling this `stop()`, so it seem that we'll never be able to `enterBusy()` and we'll never set `stop` to `true` 



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] IGNITE-21226 NPE throws from MessageServiceImpl if service already stopped but incoming message still processed [ignite-3]

Posted by "rpuch (via GitHub)" <gi...@apache.org>.
rpuch commented on code in PR #3026:
URL: https://github.com/apache/ignite-3/pull/3026#discussion_r1446940300


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/message/MessageServiceImpl.java:
##########
@@ -146,8 +154,18 @@ private void onMessageInternal(String consistentId, NetworkMessage msg) {
     /** {@inheritDoc} */
     @Override
     public void stop() {
-        if (lsnrs != null) {
-            lsnrs.clear();
+        if (!busyLock.enterBusy()) {
+            return;

Review Comment:
   `SqlQueryProcessor` blocks the busy lock before calling this `stop()`, so it seems that we'll never be able to `enterBusy()` and we'll never set `stop` to `true` 



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@ignite.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org