- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我正在使用 Node 6.9 生成一个子进程。
const child = require('child_process').execFile('command', args);
child.stdout.on('data', (data) => {
console.log('child:', data);
});
child.stderr.on('data', (data) => {
console.log('child:', data);
});
child.on('close', (code, signal) => {
console.log(`ERROR: child terminated. Exit code: ${code}, signal: ${signal}`);
});
我的子进程运行了大约 1 分钟 30 秒,但随后我从我的 Node.js 程序中得到了这个输出:
ERROR: child terminated. Exit code: null, signal: SIGTERM
什么终止了我的子进程,为什么?
编辑:我添加了 killSignal: 'SIGILL' 作为选项。
var child = require('child_process').execFile('geth', args, { killSignal: 'SIGILL'});
现在,我明白了:
ERROR: go-ethereum terminated. Exit code: 2, signal: null
最佳答案
我找到了问题和解决方案。
maxBuffer largest amount of data (in bytes) allowed on stdout or stderr - if exceeded child process is killed (Default: 200*1024)
我可以将 maxBuffer
选项设置得更高。
childProcess.execFile('geth', args, { maxBuffer: 400 * 1024});
似乎您无法禁用 maxBuffer
选项,即使将其设置为 0 也无法禁用。但这似乎是故意的。
关于Node.js 子进程以 SIGTERM 退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43401872/
当前在我的 Windows 机器上使用 Codeception 运行 PHPUnit 时出现错误: [PHPUnit_Framework_Exception] Use of undefined con
当我的 Dockerfile 以 结尾时 CMD node . docker 使用命令 /bin/sh -c "node ." 运行该容器而不是简单的 node . (我知道,我可以用 CMD ["n
在Airflow v2.6.3上,我每天运行Spark作业。每隔一段时间,DAG中的成功作业都会通过EMR传感器重试该作业。重试的作业将显示“此实例的状态已在外部设置为up_for_retry。正在终
$ cat SIGTERM #!/bin/bash set -eu flag_file=$(xdg-user-dir DESKTOP)/SIGTERM-TRAPPED trap 'touch "$fl
我有一个单线程进程,它不会因 kill -TERM 而死亡。过程 信号掩码不显示 SIGTERM 被阻止。我正在执行“杀死” 根。我可以使用 SIGKILL 终止进程,但这是更大范围的一部分 系统,我
我有一个 bash 脚本调用 run.sh启动多个进程 #!/bin/bash proc1 & proc2 & proc3 & final # this runs until sigterm 当我执行
我正在摆弄多处理和信号。我正在创建一个池,并让工作人员捕获 SIGTERM。没有明显的原因,我观察到子进程随机接收 SIGTERM 。这是一个 MWE: import multiprocessing
Java 有没有办法处理接收到的 SIGTERM? 我正在运行一个 java 服务,但不想在用户注销时关闭我的 java 服务。 只想覆盖 sigterm 关闭处理程序,但保留其余信号的处理程序。 d
操作系统 (Linux) 可以向进程发送 SIGTERM 吗?如果是,什么时候?在什么情况下?例如,当我的进程写入不正确的地址内存时,操作系统会向它发送 SIGSEGV。提前致谢 最佳答案 Can O
我正在 try catch SIGTERM 信号并在来自 Linux 守护进程的处理程序中打印一条消息: void SigStop_Handler(int sig) { D(printf("**
我有一个简单的守护进程可以归结为 #include #include #include #include #include #include bool running = true; st
Java中有没有办法处理收到的SIGTERM? 我正在运行 java 服务,但不想在用户注销时关闭我的 java 服务。 只想覆盖 sigterm 关闭处理程序,但保留其余信号的处理程序。 detai
我有一个通过响应信号来运行的 C 程序。一些信号导致父进程 fork 。这允许在父级继续响应信号的同时进行其他处理。 当父级收到 SIGTERM 时,我希望 fork 的子级也收到 SIGTERM。在
我正在做这样的事情 def exitHandler(self, *args): self.stopThreads() sys.exit(2) 然后我在我的 self.run 中注册了该
我用c设计了一个消息传递接口(interface),用于在我的系统中运行的不同进程之间提供通信。该接口(interface)为此目的创建 10-12 个线程,并使用 TCP 套接字提供通信。 它工作正
我有一个可以启动和关闭进程的类。但似乎并没有关闭该进程。 我的python代码,还有其他方法,但它们工作得很好。: class KismetInstance: """Creates a kis
我的守护进程(仅限 Linux)具有以下信号处理程序: static void signal_handler(int id, siginfo_t *si, void *context) { i
有一个守护进程有两个线程:th1,th2。 th2 使用 read(2) 读取套接字。 如果我用 SIGTERM 终止守护进程,th1 会捕获并处理信号(设置终止标志),在调用守护进程析构函数之后,它
我的程序如下: #include #include #include #include int main() { struct sigaction new_sa; struct
如果 Python 接收到 SIGTERM 但没有为其注册信号处理程序,默认情况下会在幕后做什么? 最佳答案 基于 Thomas Wouters 的回答,python 没有为 SIGTERM 信号注册
我是一名优秀的程序员,十分优秀!