Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[CURATOR-636] Make PersistentTtlNode initialDelay more configurable

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

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
38/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java

調査の方向性

PersistentTtlNode.java から始めて scheduleAtFixedRate の呼び出しを調査し、初回遅延と繰り返し周期が現在 ttlMs と touchScheduleFactor からどのように導出されているかに注目してください。このノードに設定がどこから渡されるかを特定し、そのうえで、keep-alive の周期が意図されたスケジュールを維持したまま、初回遅延を独立して制御できることを確認してください。

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

説明

imported-jira-issue rfe

Currently when PersistentTtlNode starts, it will

  1. create a CONTAINER node
  2. create a CHILD node `_touch`

But there is a initialDelay between 1 and 2. If the initialDelay is long enough and the client is disconnected, 1 will not be deleted forever (because CONTAINER node only delete its parent when all its child is gone, but in this case, it never has any of them).

The initialDelay could be configured, but not so flexible. The initialDelay is calculated by the formula `ttl/touchScheduleFactor`, but this formula is also used to how frequent we want to ping Zookeeper to keep our znodes alive, aka period.

As you can see here (2nd parameter is initialDelay and 3rd parameter is for period)

// PersistentTtlNode.java
Future future = executorService.scheduleAtFixedRate(touchTask, ttlMs / touchScheduleFactor, ttlMs / touchScheduleFactor, TimeUnit.MILLISECONDS);
 
// Interface ScheduledExecutorService
ScheduledFuture scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)

Let's say we have ttl of 5 minutes. We want to have 0 initialDelay so we will set the touchScheduleFactor to 5 minutes too. This will give us 1ms (5 minutes/5 minutes) of initialDelay (which solves our problem) but spamming Zookeeper every second.

So it would be nice if we can set `initialDelay` 


Originally reported by yang-wei, imported from: Make PersistentTtlNode initialDelay more configurable
  • status: Open
  • priority: Minor
  • resolution: Unresolved
  • imported: 2025-01-21
主要言語
Java
スター
3.2k
フォーク
1.2k
平均マージ
14時間 48分
マージ済み PR(30日)
2

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

apache/curator のほかの issue

apache/curator の issue をすべて見る

似ている issue

Java の issue をもっと見る

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

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