Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4DF8D92C5 for ; Thu, 8 Dec 2011 07:32:09 +0000 (UTC) Received: (qmail 62254 invoked by uid 500); 8 Dec 2011 07:32:09 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 62143 invoked by uid 500); 8 Dec 2011 07:32:06 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 61948 invoked by uid 99); 8 Dec 2011 07:32:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 07:32:01 +0000 X-ASF-Spam-Status: No, hits=-2001.2 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 08 Dec 2011 07:32:00 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 32BB41067A2 for ; Thu, 8 Dec 2011 07:31:40 +0000 (UTC) Date: Thu, 8 Dec 2011 07:31:40 +0000 (UTC) From: "Brian LeRoux (Commented) (JIRA)" To: callback-dev@incubator.apache.org Message-ID: <820593283.52730.1323329500209.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <863880628.49570.1323271600161.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CB-107) Possible socket leaking in CallbackServer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-107?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13165061#comment-13165061 ] Brian LeRoux commented on CB-107: --------------------------------- I created a test app to see if I could reproduce the issue here: https://gist.github.com/1446383 No luck reproducing it, the test app in its current form works, is there anything I'm missing in assumptions about how this should fail? In the meantime, logcat did uncover this occasional exception from phonegapjs: D/PhoneGapLog(14838): file:///android_asset/www/phonegap-1.3.0rc1.js: Line 2787 : Uncaught 7 E/Web Console(14838): Uncaught 7 at file:///android_asset/www/phonegap-1.3.0rc1.js:2787 which I will investigate separately > Possible socket leaking in CallbackServer > ----------------------------------------- > > Key: CB-107 > URL: https://issues.apache.org/jira/browse/CB-107 > Project: Apache Callback > Issue Type: Bug > Components: Android > Affects Versions: 1.2.0 > Reporter: Simon MacDonald > Priority: Critical > > I think we may be leaking a socket in CallbackServer. On line 216 of the CallbackServer we create a new Socket but I can't see anywhere in CallbackServer where the Socket is closed. Over time this could cause the problem described below. The user is probably running into it much sooner than usual as he's making a file write every second. > Here is the original bug report from the Google Groups: > I'm trying to write approx every second to a file. This for writing a > geolocation to this file. > So I make a filewriter when I start tracking, then start a > watchposition en in the successfunction I write to this file. > In my first tests everything went well, but with some more intensive > testing we found out that after more than 900 points (or > filewritervar.write() callings) the app fails. In the logcat the next > error is vissible: > [code] > W/System.err(27919): java.net.SocketException: Too many open files > W/System.err(27919): at > org.apache.harmony.luni.platform.OSNetworkSystem.acceptSocketImpl(Native > Method) > W/System.err(27919): at > org.apache.harmony.luni.platform.OSNetworkSystem.accept(OSNetworkSystem.java: > 69) > W/System.err(27919): at > org.apache.harmony.luni.net.PlainSocketImpl.accept(PlainSocketImpl.java: > 126) > W/System.err(27919): at > java.net.ServerSocket.implAccept(ServerSocket.java:281) > W/System.err(27919): at > java.net.ServerSocket.accept(ServerSocket.java:165) > W/System.err(27919): at > com.phonegap.CallbackServer.run(CallbackServer.java:216) > W/System.err(27919): at java.lang.Thread.run(Thread.java:1102) > [/code] > I looked in the FileUtils.java file and the filestream is everytime > correctly closed, so I dont see the problem. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira