Announcement Announcement Module
No announcement yet.
ItemWriter with Unix process is hanging Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • ItemWriter with Unix process is hanging

    So we have a itemwriter that spawns a Unix curl process to download a result from a REST service into a file. This writer waits for the process to complete before proceeding to the next step. This step with this writer worked fine but suddenly stopped running/hanging without any changes from our end. So the job starts and never comes out of the UNIX process. When we do a process check (ps -eaf|grep "curl") it shows the curl process running. We checked the following:
    ** REST service is responding and works fine.
    ** Wrote a simple java class doing the same thing which also works fine.

    So we took a thread dump to see the below entry for SimpleAsyncTaskExecuter-2

    Did anyone else have this same issue? We are not sure if this is related to Spring batch but cannot think of anything as this hangs only when part of batch processing.

    Any inputs on how to get further information would be great. We use java version "1.6.0_11" and the job is running on jboss 4.2.3

    "SimpleAsyncTaskExecutor-2" prio=10 tid=0x092c9800 nid=0x2afe in Object.wait() [0x72a63000..0x72a63f20]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(
    at java.lang.UNIXProcess.waitFor( )
    - locked <0x7aa29a60> (a java.lang.UNIXProcess)
    at com.msc.batch.RESTResponseFileItemWriter.write(RES
    at org.springframework.batch.core.step.item.SimpleChu nkProcessor.writeItems( 56)
    at org.springframework.batch.core.step.item.SimpleChu nkProcessor.doWrite(
    at org.springframework.batch.core.step.item.FaultTole rantChunkProcessor$3.doWithRetry(FaultTolerantChun
    at ate.doExecute(
    at ate.execute(
    at org.springframework.batch.core.step.item.BatchRetr yTemplate.execute(
    at org.springframework.batch.core.step.item.FaultTole rantChunkProcessor.write(FaultTolerantChunkProcess
    at org.springframework.batch.core.step.item.SimpleChu nkProcessor.process(
    at org.springframework.batch.core.step.item.ChunkOrie ntedTasklet.execute(
    at org.springframework.batch.core.step.tasklet.Taskle tStep$ChunkTransactionCallback.doInTransaction(Tas
    at nTemplate.execute(
    at org.springframework.batch.core.step.tasklet.Taskle tStep$2.doInChunkContext(
    at org.springframework.batch.core.scope.context.StepC ontextRepeatCallback.doInIteration(StepContextRepe
    at plate.getNextResult(
    at plate.executeInternal(
    at plate.iterate(
    at org.springframework.batch.core.step.tasklet.Taskle tStep.doExecute(
    at org.springframework.batch.core.step.AbstractStep.e xecute(
    at org.springframework.batch.core.job.SimpleStepHandl er.handleStep(
    at org.springframework.batch.core.job.flow.JobFlowExe cutor.executeStep(
    at ate.StepState.handle(
    at mpleFlow.resume(
    at mpleFlow.start(
    at Execute(
    at org.springframework.batch.core.job.AbstractJob.exe cute(
    at leJobLauncher$

  • #2
    I couldn't say why the UNIX process is hanging (or rather why the JVM is hanging waiting for it). It seems like a complicated solution and quite inefficient though. Why not use RestTemplate in your Java process to access the resource?