linux - OSGi based java process blocked when called using apache ant based exec task - Stack Overflow

I have build.xml trigger from Java application. it contains exec task similar to below to call osgi bas

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?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744145225a4560390.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信