graphprotocol / graphprotocol/graph-node

[Feature] Graceful shutdown

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

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

enhancement
主要言語
Rust
スター
3.2k
フォーク
1.1k
平均マージ
4日 1時間
マージ済み PR(30日)
1

説明

Description

I'm using graph-node in kubernetes with a sql proxy to connect to postgresql.

When I do a replace of the graph-node, kubernetes sends a SIGTERM and will wait 30s before forcing a shutdown.
I'm waiting 30s in the SQL proxy to let the graph-node to finish its queries.
But the graph-node does not stop, It just sends errors because the database goes away and waits for kubernetes to force the kill of the pod.

A nice feature would be to permit a graceful shutdown of the graph-node.
It should stop indexing on SIGTERM, finish its sql queries and disconnect to the database.
More, it can prevent some unexpected issues in postgresql database like bad block caching.

An indexer node or query has actually the same behaviour.

Are you aware of any blockers that must be resolved before implementing this feature? If so, which? Link to any relevant GitHub issues.

No response

Some information to help us out
  • Tick this box if you plan on implementing this feature yourself.
  • I have searched the issue tracker to make sure this issue is not a duplicate.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

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

調査の方向性

まず、graph-node が SIGTERM をどのように処理し、インデックス作成プロセスとクエリプロセスをどのように停止するかを追跡します。Kubernetes と SQL proxy を使用したシャットダウン動作を確認し、30 秒間の終了ウィンドウが終わる前に、インデックス作成が停止し、実行中の SQL クエリが完了し、PostgreSQL 接続が切断されることを検証します。

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

評価

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

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

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