cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Ellis (JIRA)" <j...@apache.org>
Subject [jira] Commented: (CASSANDRA-552) file descriptor leak in getKeyRange
Date Fri, 13 Nov 2009 21:28:39 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-552?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777670#action_12777670
] 

Jonathan Ellis commented on CASSANDRA-552:
------------------------------------------

committed to trunk.

0.4 code is different enough that this patch will not apply.  (It shouldn't be necessary,
either, from my reading of the code, but if 0.4 does indeed leak FDs I don't think fixing
it is worth the effort with 0.5 coming soon.)

> file descriptor leak in getKeyRange
> -----------------------------------
>
>                 Key: CASSANDRA-552
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-552
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Jonathan Ellis
>            Assignee: Jonathan Ellis
>             Fix For: 0.5
>
>         Attachments: 552.patch
>
>
> paste from mailing list:
> Cassandra reported the following:
> WARN [GMFD:1] 2009-11-12 16:07:24,961 MessagingService.java (line 393)
> Exception was generated at : 11/12/2009 16:07:24 on thread GMFD:1
> Too many open files
> java.net.SocketException: Too many open files
>        at sun.nio.ch.Net.socket0(Native Method)
>        at sun.nio.ch.Net.socket(Unknown Source)
>        at sun.nio.ch.DatagramChannelImpl.<init>(Unknown Source)
>        at sun.nio.ch.SelectorProviderImpl.openDatagramChannel(Unknown
> Source)
>        at java.nio.channels.DatagramChannel.open(Unknown Source)
>        at
> org.apache.cassandra.net.UdpConnection.init(UdpConnection.java:49)
>        at
> org.apache.cassandra.net.MessagingService.sendUdpOneWay(MessagingService.java:388)
>        at
> org.apache.cassandra.gms.GossipDigestSynVerbHandler.doVerb(Gossiper.java:889)
>        at
> org.apache.cassandra.net.MessageDeliveryTask.run(MessageDeliveryTask.java:38)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
>        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
> Source)
>        at java.lang.Thread.run(Unknown Source)
> Lsof reports that the java process has 65486 files open (I have ulimit
> -n 65535 set in cassandra.in.sh).  Many of the lsof entries include a
> trailing '(deleted)' comment after the file path.
> This appears to be similar to CASSANDRA-283.  Anyone have a work around
> for this?  Would a forced GC take care of the ones marked deleted?
> Here is my sample code to count the number of keys:
> public class CClient
> {
>    public static void main(String[] args)
>    throws TException, InvalidRequestException, UnavailableException,
> UnsupportedEncodingException, NotFoundException
>    {
>        TTransport tr = new TSocket("localhost", 9160);
>        TProtocol proto = new TBinaryProtocol(tr);
>        Cassandra.Client client = new Cassandra.Client(proto);
>        tr.open();
>        int     count = 0;
>        int     block = 1000;
>        String  key   = " ";
>        while (true)
>        {
>            List<String> list = client.get_key_range("Keyspace1",
>                "Standard1", key, "~", block, ConsistencyLevel.ONE);
>            int size = list.size();
>            if (size == 0)
>                break;
>            count += size;
>            key = list.get(size - 1) + '~';
>            System.out.println("Count: " + Integer.toString(count));
>       }
>        tr.close();
>    }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message