I have build.xml trigger from Java application. it contains exec
task similar to below to call osgi based Java service
<exec dir="${dir}" executable="${root}/rrb"
failonerror="true" resultproperty="exit.code">
<arg value="${build.id}:${build.id}"/>
<arg value="-buildFile" />
<arg value="${shareFile}" />
<arg value="-buildFile" />
<arg value="${propertyFile}" />
</exec>
These services are running using RHEL 8.10.
In case of successful completion with exit code 0 everything working fine and both the process successfully terminate from the server while in case of failure (exit code 1) these processes remain active even after completion of process execution.
Below is the output of strace
command for child process. It looks to me that output stream is blocked between parent (ant) and child (osgi service) and they are waiting for indefinite time
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 0) = 0 (Timeout)
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvmsg(3, {msg_namelen=0}, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, -1
When I do netstat
of child process found below:
unix 3 [ ] STREAM CONNECTED 1498769 79243/rrb
unix 3 [ ] STREAM CONNECTED 1498768 79243/rrb
unix 3 [ ] STREAM CONNECTED 1498765 79243/rrb
Can you please help me to understand why this is happening?