You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Radim Kolar <hs...@filez.com> on 2012/07/22 16:36:05 UTC
findbugs
I used findbugs on cassandra and it returns 69 possible errors.
most problematic part of code is CQL - lot of null pointer problems there
some interesting errors:
C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/service/AntiEntropyService.java:916
Condition.await() not in loop in
org.apache.cassandra.service.AntiEntropyService$RepairSession$RepairJob.addTree(AntiEntropyService$TreeRequest,
MerkleTree)
C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/service/StorageProxy.java:370
Null passed for nonnull parameter of
org.apache.cassandra.utils.UUIDGen.decompose(UUID) in
org.apache.cassandra.service.StorageProxy$5.runMayThrow()
C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/db/compaction/CompactionManager.java:157
org.apache.cassandra.db.compaction.CompactionManager$2.call() does not
release lock on all paths
C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/db/compaction/CompactionManager.java:248
org.apache.cassandra.db.compaction.CompactionManager$6.runMayThrow()
does not release lock on all paths
C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/utils/SimpleCondition.java:34
Monitor wait() called on a Condition in
org.apache.cassandra.utils.SimpleCondition.await() ** important! **
C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:224
Result of integer multiplication cast to long in
org.apache.cassandra.db.compaction.LeveledManifest.maxBytesForLevel(int)
Re: findbugs
Posted by Radim Kolar <hs...@filez.com>.
Dne 30.7.2012 16:47, Edward Capriolo napsal(a):
> I am sure no one would have an issue with an optional findbugs target.
https://issues.apache.org/jira/browse/CASSANDRA-4891
here you have optional findbugs target.
Re: findbugs
Posted by Zoltan Farkas <zo...@yahoo.com>.
Findbugs can be customized with a exclude filter to exclude from checking issues that produce a high number of false positives.
For the rest of "false positives" @suppresswarnings annotation can be used.
I suggest Understanding the issue Findbugs highlights before suppressing it, I did see devs being lazy and causing production outages...
There is no good reason for not running Findbugs as part of the build.
cheers.
--z
On Jul 30, 2012, at 10:53 AM, Brandon Williams <dr...@gmail.com> wrote:
> On Mon, Jul 30, 2012 at 9:52 AM, Jonathan Ellis <jb...@gmail.com> wrote:
>> Is Jenkins smart enough to be able to say, "I know we had X findbugs
>> warnings previously, which are known to be false positives, but now
>> there are X+1" ?
>
> In my experience, jenkins hasn't even been smart enough to build
> cassandra in a couple of years.
>
> -Brandon
Re: findbugs
Posted by Brandon Williams <dr...@gmail.com>.
On Mon, Jul 30, 2012 at 9:52 AM, Jonathan Ellis <jb...@gmail.com> wrote:
> Is Jenkins smart enough to be able to say, "I know we had X findbugs
> warnings previously, which are known to be false positives, but now
> there are X+1" ?
In my experience, jenkins hasn't even been smart enough to build
cassandra in a couple of years.
-Brandon
Re: findbugs
Posted by Radim Kolar <hs...@filez.com>.
Dne 30.7.2012 16:52, Jonathan Ellis napsal(a):
> Is Jenkins smart enough to be able to say, "I know we had X findbugs
> warnings previously, which are known to be false positives, but now
> there are X+1" ?
yes. Look at hadoop project pre-commit check builds.
Re: findbugs
Posted by Jonathan Ellis <jb...@gmail.com>.
Is Jenkins smart enough to be able to say, "I know we had X findbugs
warnings previously, which are known to be false positives, but now
there are X+1" ?
On Mon, Jul 30, 2012 at 9:47 AM, Edward Capriolo <ed...@gmail.com> wrote:
> I am sure no one would have an issue with an optional findbugs target.
>
> On Mon, Jul 30, 2012 at 10:32 AM, Radim Kolar <hs...@filez.com> wrote:
>> was any decision about findbugs made? you do not consider code style
>> recommended by findbugs as good practice which should be followed?
>>
>> I can submit few findbugs patches, but it will probably turns into flamewar
>> WE vs FINDBUGS like there:
>> https://issues.apache.org/jira/browse/HADOOP-8619
>>
>> findbugs problems are pretty easy to fix and there are just 70 of them, it
>> could be done in two days.
>>
>> I do not care about findbugs+cas-dev issue much because i need to fork
>> cassandra anyway to get performance patches there. Its just matter of
>> schedule for me if 1 should feed you fb patches before i fork it.
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com
Re: findbugs
Posted by Edward Capriolo <ed...@gmail.com>.
I am sure no one would have an issue with an optional findbugs target.
On Mon, Jul 30, 2012 at 10:32 AM, Radim Kolar <hs...@filez.com> wrote:
> was any decision about findbugs made? you do not consider code style
> recommended by findbugs as good practice which should be followed?
>
> I can submit few findbugs patches, but it will probably turns into flamewar
> WE vs FINDBUGS like there:
> https://issues.apache.org/jira/browse/HADOOP-8619
>
> findbugs problems are pretty easy to fix and there are just 70 of them, it
> could be done in two days.
>
> I do not care about findbugs+cas-dev issue much because i need to fork
> cassandra anyway to get performance patches there. Its just matter of
> schedule for me if 1 should feed you fb patches before i fork it.
Re: findbugs
Posted by Zoltan Farkas <zo...@yahoo.com>.
Running Findbugs from ant is simple as well, just google "ant Findbugs", plenty of doc and examples on how to do it...
--z
On Jul 30, 2012, at 11:18 AM, Radim Kolar <hs...@filez.com> wrote:
> i am using maven to build cassandra. i didnt have in mind to contribute build system because you are not interested in maven. In maven you just call findbugs plugin, nothing special to contribute. I had in mind patch fixing various FB discovered problems. but because its difficult to post it as many JIRA tickets, it will not be much useful. Maybe post report to list?
>
> you can create exlude list for FB with list of known false positives, its an xml file.
> <?xml version="1.0" encoding="UTF-8"?>
> <FindBugsFilter>
> <Match>
> <Bug pattern="SWL_SLEEP_WITH_LOCK_HELD" />
> </Match>
> </FindBugsFilter>
Re: findbugs
Posted by Radim Kolar <hs...@filez.com>.
i am using maven to build cassandra. i didnt have in mind to contribute
build system because you are not interested in maven. In maven you just
call findbugs plugin, nothing special to contribute. I had in mind patch
fixing various FB discovered problems. but because its difficult to post
it as many JIRA tickets, it will not be much useful. Maybe post report
to list?
you can create exlude list for FB with list of known false positives,
its an xml file.
<?xml version="1.0" encoding="UTF-8"?>
<FindBugsFilter>
<Match>
<Bug pattern="SWL_SLEEP_WITH_LOCK_HELD" />
</Match>
</FindBugsFilter>
Re: findbugs
Posted by Jonathan Ellis <jb...@gmail.com>.
I don't think there is much value in integrating it into the build
process, since there is a fairly high rate of false positives.
Intermittently running it manually could be valuable, and we have done
this in the past.
On Mon, Jul 30, 2012 at 9:32 AM, Radim Kolar <hs...@filez.com> wrote:
> was any decision about findbugs made? you do not consider code style
> recommended by findbugs as good practice which should be followed?
>
> I can submit few findbugs patches, but it will probably turns into flamewar
> WE vs FINDBUGS like there:
> https://issues.apache.org/jira/browse/HADOOP-8619
>
> findbugs problems are pretty easy to fix and there are just 70 of them, it
> could be done in two days.
>
> I do not care about findbugs+cas-dev issue much because i need to fork
> cassandra anyway to get performance patches there. Its just matter of
> schedule for me if 1 should feed you fb patches before i fork it.
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com
Re: findbugs
Posted by Radim Kolar <hs...@filez.com>.
was any decision about findbugs made? you do not consider code style
recommended by findbugs as good practice which should be followed?
I can submit few findbugs patches, but it will probably turns into
flamewar WE vs FINDBUGS like there:
https://issues.apache.org/jira/browse/HADOOP-8619
findbugs problems are pretty easy to fix and there are just 70 of them,
it could be done in two days.
I do not care about findbugs+cas-dev issue much because i need to fork
cassandra anyway to get performance patches there. Its just matter of
schedule for me if 1 should feed you fb patches before i fork it.
Re: findbugs
Posted by Radim Kolar <hs...@filez.com>.
Dne 23.7.2012 16:34, Zoltan Farkas napsal(a):
> In general, I prefer integrating findbugs into the build process and fail the build if issues are found. I am a strong believer in this approach, increases the quality of the project significantly.
Thats true, i am currently in process of fixing findbugs discovered
problems in my other project (120k lines). i was amazed how much bugs
was left in the code even if we have quite good code coverage.
Re: findbugs
Posted by Zoltan Farkas <zo...@yahoo.com>.
In general, I prefer integrating findbugs into the build process and fail the build if issues are found. I am a strong believer in this approach, increases the quality of the project significantly.
Enforcing coding style and complexity rules is one step further...
Cheers
--z
On Jul 23, 2012, at 3:39 AM, Radim Kolar <hs...@filez.com> wrote:
> The line numbers here don't appear to match with trunk.
>
> you are right, it was from old trunk 415 commits old. It was just demo of findbugs, for serious use developers should install findbugs maven plugin or eclipse plugin (preferred).
Re: findbugs
Posted by Radim Kolar <hs...@filez.com>.
The line numbers here don't appear to match with trunk.
you are right, it was from old trunk 415 commits old. It was just demo
of findbugs, for serious use developers should install findbugs maven
plugin or eclipse plugin (preferred).
Re: findbugs
Posted by Jonathan Ellis <jb...@gmail.com>.
The line numbers here don't appear to match with trunk.
On Sun, Jul 22, 2012 at 9:36 AM, Radim Kolar <hs...@filez.com> wrote:
> I used findbugs on cassandra and it returns 69 possible errors.
>
> most problematic part of code is CQL - lot of null pointer problems there
>
> some interesting errors:
>
> C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/service/AntiEntropyService.java:916
> Condition.await() not in loop in
> org.apache.cassandra.service.AntiEntropyService$RepairSession$RepairJob.addTree(AntiEntropyService$TreeRequest,
> MerkleTree)
>
> C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/service/StorageProxy.java:370
> Null passed for nonnull parameter of
> org.apache.cassandra.utils.UUIDGen.decompose(UUID) in
> org.apache.cassandra.service.StorageProxy$5.runMayThrow()
>
> C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/db/compaction/CompactionManager.java:157
> org.apache.cassandra.db.compaction.CompactionManager$2.call() does not
> release lock on all paths
>
> C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/db/compaction/CompactionManager.java:248
> org.apache.cassandra.db.compaction.CompactionManager$6.runMayThrow() does
> not release lock on all paths
>
> C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/utils/SimpleCondition.java:34
> Monitor wait() called on a Condition in
> org.apache.cassandra.utils.SimpleCondition.await() ** important! **
>
> C:/apache-nutch/eclipse/cassandra/src/java/org/apache/cassandra/db/compaction/LeveledManifest.java:224
> Result of integer multiplication cast to long in
> org.apache.cassandra.db.compaction.LeveledManifest.maxBytesForLevel(int)
>
--
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com