groovy
  1. groovy
  2. GROOVY-4048

waitForProcessOutput should also waitFor internally

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.7, 1.7.0
    • Fix Version/s: 1.7.1, 1.8-beta-1
    • Component/s: groovy-jdk
    • Labels:
      None
    • Environment:
      OS X, Ubuntu
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Related to GROOVY-3796, there is a race condition where someone could use waitForProcessOutput() and then call exitValue and get an 'java.lang.IllegalThreadStateException: process hasn't exited' error, since the actual process itself hasn't terminated. This can be worked around with a process.waitForProcessOutput(); process.waitFor(), but this is confusing since waitForProcessOutput also implies that we wait for everything.

      This patch adds a specific waitFor() to waitForProcessOutput()

      1. wf.patch
        2 kB
        Jim Jagielski

        Activity

        Hide
        Paul King added a comment -

        Added to trunk and 1_7_X. Thanks for the patch.

        Show
        Paul King added a comment - Added to trunk and 1_7_X. Thanks for the patch.

          People

          • Assignee:
            Paul King
            Reporter:
            Jim Jagielski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: