最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin4浏览0评论

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?

发布评论

评论列表(0)

  1. 暂无评论