Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AACF9F197 for ; Fri, 12 Apr 2013 00:01:16 +0000 (UTC) Received: (qmail 3503 invoked by uid 500); 12 Apr 2013 00:01:16 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 3486 invoked by uid 500); 12 Apr 2013 00:01:16 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 3283 invoked by uid 99); 12 Apr 2013 00:01:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 00:01:16 +0000 Date: Fri, 12 Apr 2013 00:01:16 +0000 (UTC) From: "Joe Bowser (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CB-2787) PhoneGap FileTransfer.Download more than 300 files 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-2787?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13629598#comment-13629598 ] Joe Bowser commented on CB-2787: -------------------------------- I don't like how this is being serialized, but I don't think it's your fault. I'd add a timeout to get around this issue, but I think we're not closing the files when we hit the callback, leading us to have too many files opened. > PhoneGap FileTransfer.Download more than 300 files > -------------------------------------------------- > > Key: CB-2787 > URL: https://issues.apache.org/jira/browse/CB-2787 > Project: Apache Cordova > Issue Type: Bug > Components: Android > Affects Versions: 2.5.0 > Reporter: Cho > Assignee: Filip Maj > > I had tried to download more than 300 files and then it hit error after that. Seems like some IO Connection was not properly closed. I wrote a small code to test it out. > Any idea? How to file a report or get a source of phonegap to check the real cause? > {code} > var counter = 500; > function DownloadFile() { > if (counter == 0) { > DownloadComplete(); > return; > } > var ft = new FileTransfer(); > var downloadUrl = ""; > var dlPath = "" > ft.download(downloadUrl, dlPath, function(entry) { > counter--; > UpdateProgress(); > DownloadFile(); > }, function(error) { > DownloadFailed(); > }, true); > } > {code} > note: and is alright because it was it failed when the counter goes until 300+. > {code} > 03-14 08:35:09.706: E/FileTransfer(24867): {"target":"","source":"","http_status":200,"code":1} > 03-14 08:35:09.706: E/FileTransfer(24867): java.io.FileNotFoundException: : open failed: EMFILE (Too many open files) > 03-14 08:35:09.706: E/FileTransfer(24867): at libcore.io.IoBridge.open(IoBridge.java:416) > 03-14 08:35:09.706: E/FileTransfer(24867): at java.io.FileOutputStream.(FileOutputStream.java:88) > 03-14 08:35:09.706: E/FileTransfer(24867): at java.io.FileOutputStream.(FileOutputStream.java:73) > 03-14 08:35:09.706: E/FileTransfer(24867): at org.apache.cordova.FileTransfer$4.run(FileTransfer.java:685) > 03-14 08:35:09.706: E/FileTransfer(24867): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) > 03-14 08:35:09.706: E/FileTransfer(24867): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) > 03-14 08:35:09.706: E/FileTransfer(24867): at java.lang.Thread.run(Thread.java:856) > 03-14 08:35:09.706: E/FileTransfer(24867): Caused by: libcore.io.ErrnoException: open failed: EMFILE (Too many open files) > 03-14 08:35:09.706: E/FileTransfer(24867): at libcore.io.Posix.open(Native Method) > 03-14 08:35:09.706: E/FileTransfer(24867): at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110) > 03-14 08:35:09.706: E/FileTransfer(24867): at libcore.io.IoBridge.open(IoBridge.java:400) > 03-14 08:35:09.706: E/FileTransfer(24867): ... 6 more > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira