Skip to content

RATIS-2454. Findbugs summary is empty despite violations#1396

Open
adoroszlai wants to merge 1 commit intoapache:masterfrom
adoroszlai:RATIS-2454
Open

RATIS-2454. Findbugs summary is empty despite violations#1396
adoroszlai wants to merge 1 commit intoapache:masterfrom
adoroszlai:RATIS-2454

Conversation

@adoroszlai
Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Even if there are findbugs failures, summary.txt is not created:

No files were found with the provided path: target/findbugs

because Spotbugs CLI commands (required for post-processing output created by Maven run) are not available in GitHub.

Install Spotbugs in subdirectory of .dev-tools (installation script taken from Ozone, where it has been in use for few years).

https://issues.apache.org/jira/browse/RATIS-2454

How was this patch tested?

Current state (without violations):

$ ./dev-support/checks/findbugs.sh
mkdir: created directory '.dev-tools'
mkdir: created directory '.dev-tools/spotbugs'
...
Installed spotbugs in .dev-tools/spotbugs
...
[INFO] BUILD SUCCESS
...

$ echo $?
0

$ ls -1s target/findbugs
total 448
  4 failures
 68 output.log
236 summary.html
  0 summary.txt
140 summary.xml

$ cat target/findbugs/failures
0

With some violations introduced temporarily:

$ git revert --no-commit eb465d56
$ git reset HEAD -- ratis-server/dev-support/findbugsExcludeFile.xml
$ git checkout -- ratis-server/dev-support/findbugsExcludeFile.xml

$ ./dev-support/checks/findbugs.sh
...
[INFO] BUILD SUCCESS
...

$ echo $?
1

$ ls -1s target/findbugs                                          
total 464
  4 failures
 68 output.log
240 summary.html
  4 summary.txt
148 summary.xml

$ cat target/findbugs/failures
0

$ cat target/findbugs/summary.txt 
M B CT: Exception thrown in class org.apache.ratis.server.impl.LeaderElection at new org.apache.ratis.server.impl.LeaderElection(LeaderElection$ServerInterface, boolean) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.  At LeaderElection.java:[line 324]
M B CT: Exception thrown in class org.apache.ratis.server.impl.LeaderElection at new org.apache.ratis.server.impl.LeaderElection(RaftServerImpl, boolean) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.  At LeaderElection.java:[line 310]
M B CT: Exception thrown in class org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader at new org.apache.ratis.server.raftlog.segmented.SegmentedRaftLogReader(File, SizeInBytes, SegmentedRaftLogMetrics) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.  At SegmentedRaftLogReader.java:[line 155]
M B CT: Exception thrown in class org.apache.ratis.server.storage.FileChunkReader at new org.apache.ratis.server.storage.FileChunkReader(FileInfo, Path) will leave the constructor. The object under construction remains partially initialized and may be vulnerable to Finalizer attacks.  At FileChunkReader.java:[line 60]

CI:
https://github.com/adoroszlai/ratis/actions/runs/23641934315

@adoroszlai adoroszlai self-assigned this Mar 27, 2026
@adoroszlai adoroszlai added the CI label Mar 27, 2026
@adoroszlai adoroszlai changed the title RATIS-2454. Findbugs summary is empty RATIS-2454. Findbugs summary is empty despite violations Mar 27, 2026
Copy link
Copy Markdown
Contributor

@spacemonkd spacemonkd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch @adoroszlai, LGTM +1
@szetszwo could you take a look at this as well please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants