[worker] gracefully terminate when a SIGTERM is received

オープン
#376 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
go, kubernetes
領域
backend, devops

調査の方向性

まず、Go 分析ワーカーのワークループ、SIGTERM の処理、既存のコンテキスト伝播を特定します。現在の処理と sandbox の teardown がどのように管理されているかを確認します。完了とは、ワーカーが新しい処理の受け付けを停止し、猶予期間を設け、コンテキストをキャンセルし、結果を保存せずに実行を中止し、Kubernetes が SIGKILL を送信する前に終了することです。

索引モデルが issue の本文から書いたものです。

説明

enhancement good first issue

The analysis worker in Kubernetes is sent a SIGTERM, and then 30 seconds later a SIGKILL.

I would be great if the analysis worker should gracefully stop working when it receives the SIGTERM.

Ideally this should be done with an algorithm like the following:

  • don't start any new work if we've just finished
  • wait a grace period (e.g. 5-10 seconds) to see if the current work finishes successfully
  • use Go's context support to cancel a context after this grace period - if the analysis detects the context is cancelled it should immediately tear down the sandbox and abort execution without storing a result
主要言語
Go
スター
925
フォーク
75
平均マージ
4日 2時間
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ossf/package-analysis のほかの issue

ossf/package-analysis の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。