You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Joe Bowser (JIRA)" <ji...@apache.org> on 2013/10/30 20:39:26 UTC

[jira] [Resolved] (CB-2787) PhoneGap FileTransfer.Download more than 300 files

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

Joe Bowser resolved CB-2787.
----------------------------

    Resolution: Unresolved

There's been a lot of churn, we need to re-verify if this is an issue.  If you can reproduce this on 3.1.0, please re-open.

> 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, Plugin File Transfer
>    Affects Versions: 2.5.0
>            Reporter: Cho
>            Assignee: Ian Clelland
>
> 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 = "<source>";
>         var dlPath = "<target>"
>         ft.download(downloadUrl, dlPath, function(entry) {
>             counter--;
>             UpdateProgress();
>             DownloadFile();
>         }, function(error) {
>             DownloadFailed();
>         }, true);
>     }
> {code}
> note: <target> and <source> is alright because it was it failed when the counter goes until 300+.
> {code}
> 03-14 08:35:09.706: E/FileTransfer(24867): {"target":"<target>","source":"<source>","http_status":200,"code":1}
> 03-14 08:35:09.706: E/FileTransfer(24867): java.io.FileNotFoundException: <source>: 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.<init>(FileOutputStream.java:88)
> 03-14 08:35:09.706: E/FileTransfer(24867):     at java.io.FileOutputStream.<init>(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 was sent by Atlassian JIRA
(v6.1#6144)