应用程序 Java 始终以“Exit 143”结尾乌班图

发布于 2024-10-02 11:55:11 字数 133 浏览 2 评论 0原文

我有一个java应用程序,它被永久拉取了。按如下方式执行:

nohup ant> log.txt &

问题是无限期地持续下去,应用程序退出并收到消息“Exit 143”。

I have an application in java, which is permanently pulled. Execute it as follows:

nohup ant> log.txt &

The problem is that last indefinitely, the application quits and get a message "Exit 143".

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

生来就爱笑 2024-10-09 11:55:11

退出代码 143 对应于 SIGTERM,这是运行 kill 时默认发送的信号。是否有可能另一个进程或用户正在终止该应用程序?如果没有更多信息,就很难提出其他建议。

Exit code 143 corresponds to SIGTERM, which is the signal sent by default when you run kill <pid>. Is it possible that another process or user is killing the application? Without more information it's difficult to suggest anything else.

幻想少年梦 2024-10-09 11:55:11

我在使用 Nodejs 时遇到了类似的问题,结果发现实际上是我的应用程序和我的代码杀死了它。

我有这样的代码(好吧,我没有这样的函数名称,但你明白了):

kill_anything_that_is_still_running_from_previous_execution()
start_a_lot_of_stuff()

问题是 kill_anything_that_is_still_running_from_previous_execution 是异步的并立即返回(由于“运气不好”) )实际的杀戮部分总是在 start_a_lot_of_stuff 运行完成后才发生,这显然不是很好。 #spawncamping

哦,在 Java 中 Runtime.getRuntime().exec("bash -c \"killallwhatever\"") 如果你不这样做的话,就是“异步”等待它退出。

I ran into a similar issue while using nodejs, and it turned out that it was actually my app and my code that was killing it.

I had code like this (ok, i don't have function names like that, but you get the point):

kill_anything_that_is_still_running_from_previous_execution()
start_a_lot_of_stuff()

The problem was that kill_anything_that_is_still_running_from_previous_execution was async and returned immediately and (due to bad "luck") the actual killing part always ended up happening only after start_a_lot_of_stuff finished running, which is obviously not very great. #spawncamping

Oh, and in Java Runtime.getRuntime().exec("bash -c \"killall whatever\"") is "async" if you don't wait for it to exit.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文