spring-batch icon indicating copy to clipboard operation
spring-batch copied to clipboard

Add option to consume error and input streams to SystemCommandTasklet [BATCH-2318]

Open spring-projects-issues opened this issue 11 years ago • 0 comments

Peter Rietzler opened BATCH-2318 and commented

If a system command outputs data to either stderr or stdout, then Java blocks once a certain amount of data has been written to it. The tasklet will hang until it reaches the configured timeout in this case.

The following part of a Spock specification should show the problem:

def "streams of system command are consumed"() {
        def file = new File(tempDir, "a")
        file.text = (1..20000).join("")

        when:
        def execution = launchJob(command: "cat " + file.absolutePath)
        then:
        execution.exitStatus == ExitStatus.COMPLETED
}

Issue Links:

  • BATCH-2329 Add log management to SystemCommandTasklet

spring-projects-issues avatar Nov 04 '14 03:11 spring-projects-issues