You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "sashapolo (via GitHub)" <gi...@apache.org> on 2025/08/25 09:33:51 UTC

[PR] IGNITE-26287 Upgrade Spotbugs to 4.9.4 [ignite-3]

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

   https://issues.apache.org/jira/browse/IGNITE-26287
   
   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-26287 Upgrade Spotbugs to 4.9.4 [ignite-3]

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


##########
check-rules/spotbugs-excludes.xml:
##########
@@ -57,6 +57,12 @@
       <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"/>
       <!-- we specifically catch even not thrown exceptions is some places to be extra defendant -->
       <Bug pattern="REC_CATCH_EXCEPTION"/>
+      <!-- We assume 64-bit writes to be atomic. -->
+      <Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>

Review Comment:
   The code that it complains about is a million years old, so I would say that we do not support 32 bit architectures (we definitely don't have tests for them)



-- 
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-26287 Upgrade Spotbugs to 4.9.4 [ignite-3]

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


##########
modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/snapshot/RocksSnapshotManager.java:
##########


Review Comment:
   Does the new version of Spotbugs complain here (before moving the `ReadOptions` parameter out of the method)? What does it say?



##########
check-rules/spotbugs-excludes.xml:
##########
@@ -57,6 +57,12 @@
       <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"/>
       <!-- we specifically catch even not thrown exceptions is some places to be extra defendant -->
       <Bug pattern="REC_CATCH_EXCEPTION"/>
+      <!-- We assume 64-bit writes to be atomic. -->
+      <Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>

Review Comment:
   This is not necessarily true for 32 bit architectures. Do we support 32 bit architectures?



##########
check-rules/spotbugs-excludes.xml:
##########
@@ -57,6 +57,12 @@
       <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"/>
       <!-- we specifically catch even not thrown exceptions is some places to be extra defendant -->
       <Bug pattern="REC_CATCH_EXCEPTION"/>
+      <!-- We assume 64-bit writes to be atomic. -->
+      <Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>
+      <!-- These rules fail a lot because they consider some classes to be not thread safe even when they are used with external
+           synchronization or are not used in multithreaded environment at all. -->
+      <Bug pattern="AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE"/>
+      <Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>

Review Comment:
   This looks like a useful check for multi-threaded cases where external sync was somehow missed.
   
   Could this check be suppressed some other way, such as a code comment in places where the author has manually ensured thread-safety through external mechanisms?



-- 
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-26287 Upgrade Spotbugs to 4.9.4 [ignite-3]

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


##########
modules/rocksdb-common/src/main/java/org/apache/ignite/internal/rocksdb/snapshot/RocksSnapshotManager.java:
##########


Review Comment:
   Exactly, it complained that `ReadOptions` were not closed properly



-- 
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-26287 Upgrade Spotbugs to 4.9.4 [ignite-3]

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


-- 
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-26287 Upgrade Spotbugs to 4.9.4 [ignite-3]

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


##########
check-rules/spotbugs-excludes.xml:
##########
@@ -57,6 +57,12 @@
       <Bug pattern="RC_REF_COMPARISON_BAD_PRACTICE_BOOLEAN"/>
       <!-- we specifically catch even not thrown exceptions is some places to be extra defendant -->
       <Bug pattern="REC_CATCH_EXCEPTION"/>
+      <!-- We assume 64-bit writes to be atomic. -->
+      <Bug pattern="AT_NONATOMIC_64BIT_PRIMITIVE"/>
+      <!-- These rules fail a lot because they consider some classes to be not thread safe even when they are used with external
+           synchronization or are not used in multithreaded environment at all. -->
+      <Bug pattern="AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE"/>
+      <Bug pattern="AT_STALE_THREAD_WRITE_OF_PRIMITIVE"/>

Review Comment:
   This is impossible to suppress using comments because there are tons of these warnings all over the code. We may do that in a separate ticket, but I really doubt that this check is useful at all.



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