Groovy
  1. Groovy
  2. GROOVY-5049

File.getText() should close the streams

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9-beta-4, 1.8.4
    • Component/s: None
    • Labels:
      None

      Description

      Performing a lot of system calls causes Groovy to die on Linux with an IOException for "Too many open files". The cause is streams which are left open by system calls:

      (1..n).each

      { "ls".execute().text }

      This method should be changed to close all streams after it gets the text from them.

        Issue Links

          Activity

          Uri Moszkowicz created issue -
          Jochen Theodorou made changes -
          Field Original Value New Value
          Assignee Paul King [ paulk ]
          Uri Moszkowicz made changes -
          Attachment UsageAnalyzer2.groovy [ 57055 ]
          Uri Moszkowicz made changes -
          Attachment UsageAnalyzer2.groovy [ 57055 ]
          Uri Moszkowicz made changes -
          Attachment UsageAnalyzer2.groovy [ 57056 ]
          Paul King made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.8.4 [ 17852 ]
          Fix Version/s 1.9-beta-4 [ 17656 ]
          Resolution Fixed [ 1 ]
          Paul King made changes -
          Link This issue is superceded by GROOVY-5058 [ GROOVY-5058 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12733974 ] Default workflow, editable Closed status [ 12745587 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12971319 ] Default workflow, editable Closed status [ 12979109 ]

            People

            • Assignee:
              Paul King
              Reporter:
              Uri Moszkowicz
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development