[ 
https://issues.apache.org/jira/browse/CASSANDRA-16119?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sam Tunnicliffe updated CASSANDRA-16119:
----------------------------------------
          Fix Version/s:     (was: 4.0-beta)
                         4.0-beta3
          Since Version: 4.0-beta2
    Source Control Link: 
https://github.com/apache/cassandra/commit/54d297a192ca452dab5640f33fd6c22fd31e2f9c
             Resolution: Fixed
                 Status: Resolved  (was: Ready to Commit)

And committed in {{54d297a192ca452dab5640f33fd6c22fd31e2f9c}}, thanks!

> MockSchema's SSTableReader creation leaks FileHandle and Channel instances
> --------------------------------------------------------------------------
>
>                 Key: CASSANDRA-16119
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-16119
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Test/unit
>            Reporter: Caleb Rackliffe
>            Assignee: Caleb Rackliffe
>            Priority: Normal
>             Fix For: 4.0-beta3
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> {{MockSchema}} creates {{SSTableReader}} instances for testing, but when it 
> does, it doesn’t seem to ever close the {{FileHandle}} and {{Channel}} 
> instances from which copies are made for the actual readers. ({{FileHandle}} 
> itself also internally copies the channel on creation.) This can trigger leak 
> detection, although perhaps not reliably, from tests like 
> {{AntiCompactionTest}}. A couple well-placed {{try-with-resources}} blocks 
> should help us avoid this (and shouldn't risk closing anything too early, 
> since the close methods for handles and channels seem only to do reference 
> bookkeeping anyway).
> Example:
> {noformat}
> [junit-timeout] ERROR 16:35:47,747 LEAK DETECTED: a reference 
> (org.apache.cassandra.utils.concurrent.Ref$State@487c0fdb) to class 
> org.apache.cassandra.io.util.FileHandle$Cleanup@2072030898:/var/folders/4d/zfjs7m7s6x5_l93k33r5k6680000gn/T/mocksegmentedfile0tmp
>  was not released before the reference was garbage collected
> [junit-timeout] ERROR 16:35:47,747 Allocate trace 
> org.apache.cassandra.utils.concurrent.Ref$State@487c0fdb:
> [junit-timeout] Thread[main,5,main]
> [junit-timeout]       at java.lang.Thread.getStackTrace(Thread.java:1559)
> [junit-timeout]       at 
> org.apache.cassandra.utils.concurrent.Ref$Debug.<init>(Ref.java:249)
> [junit-timeout]       at 
> org.apache.cassandra.utils.concurrent.Ref$State.<init>(Ref.java:179)
> [junit-timeout]       at 
> org.apache.cassandra.utils.concurrent.Ref.<init>(Ref.java:101)
> [junit-timeout]       at 
> org.apache.cassandra.utils.concurrent.SharedCloseableImpl.<init>(SharedCloseableImpl.java:30)
> [junit-timeout]       at 
> org.apache.cassandra.io.util.FileHandle.<init>(FileHandle.java:74)
> [junit-timeout]       at 
> org.apache.cassandra.io.util.FileHandle.<init>(FileHandle.java:50)
> [junit-timeout]       at 
> org.apache.cassandra.io.util.FileHandle$Builder.complete(FileHandle.java:389)
> [junit-timeout]       at 
> org.apache.cassandra.schema.MockSchema.sstable(MockSchema.java:124)
> [junit-timeout]       at 
> org.apache.cassandra.schema.MockSchema.sstable(MockSchema.java:83)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to