Skip to content

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

@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions