Kafka Connect不停在SIGTERM上

时间:2017-08-03 08:52:24

标签: java apache-kafka systemd apache-kafka-connect

当systemd触发默认终止信号(SIGTERM)时,Kafka Connect不会完全停止。查看日志,我可以看到各个连接器任务和其他一些服务都表示他们正在停止然后报告他们实际上已停止,除了“牧人”:

[2017-08-02 17:50:06,372] INFO Kafka Connect stopping (org.apache.kafka.connect.runtime.Connect:68)
[2017-08-02 17:50:06,377] INFO Stopping REST server (org.apache.kafka.connect.runtime.rest.RestServer:154)
[2017-08-02 17:50:06,652] INFO Stopped ServerConnector@4218500f{HTTP/1.1}{0.0.0.0:8083} (org.eclipse.jetty.server.ServerConnector:306)
[2017-08-02 17:50:06,908] INFO Stopped o.e.j.s.ServletContextHandler@616fe72b{/,null,UNAVAILABLE} (org.eclipse.jetty.server.handler.ContextHandler:865)
[2017-08-02 17:50:06,929] INFO REST server stopped (org.apache.kafka.connect.runtime.rest.RestServer:165)
[2017-08-02 17:50:06,935] INFO Herder stopping (org.apache.kafka.connect.runtime.standalone.StandaloneHerder:76)
[2017-08-02 17:50:06,941] INFO Stopping task payments-kinesis-sink-0 (org.apache.kafka.connect.runtime.Worker:341)
[2017-08-02 17:50:06,950] INFO WorkerSinkTask{id=payments-kinesis-sink-0} Committing offsets (org.apache.kafka.connect.runtime.WorkerSinkTask:262)
[2017-08-02 17:50:07,025] INFO Stopping connector payments-kinesis-sink (org.apache.kafka.connect.runtime.Worker:218)
[2017-08-02 17:50:07,032] INFO Stopped connector payments-kinesis-sink (org.apache.kafka.connect.runtime.Worker:229)
[2017-08-02 17:50:07,068] INFO Worker stopping (org.apache.kafka.connect.runtime.Worker:122)
[2017-08-02 17:50:07,081] INFO Stopped FileOffsetBackingStore (org.apache.kafka.connect.storage.FileOffsetBackingStore:68)
[2017-08-02 17:50:07,082] INFO Worker stopped (org.apache.kafka.connect.runtime.Worker:142)

当发生这种情况时,该过程会挂起,直到满足systemd的TimeoutStopSec持续时间,然后发送一个SIGKILL。

为了解决这个问题,我刚刚降低了超时时间,但是在我们投入生产之前,我想让事情正确关闭。

我已经尝试查看源代码,但我无法确定它挂在哪里。

是否有一种特定方法可以阻止Kafka Connect?

0 个答案:

没有答案