🐛 Bug Report: Jobs worker stores its dedupe markers (`jobs-event-*`) in Redis without TTL
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 78/100
調査の方向性
src/Appwrite/Platform/Modules/Functions/Workers/Jobs.phpを読み、特に180、255、296行目付近のマーカーの確認と保存を確認してください。両方のマーカーを保存するときに既存のDEDUPE_TTLを渡し、その後、3600秒後にRedisがそれらを削除することを確認してください。issueには、古いマーカーキーが残る可能性も記されています。テストファイルは指定されていないため、近くにあるworkerまたはcacheのテストを調べ、適切な確認箇所を見つけてください。
索引モデルが issue の本文から書いたものです。
説明
In short: The jobs worker reads its dedupe markers with a 3600 s TTL but writes them without one, so Redis keeps every marker forever.
Impact:
- One Redis hash per build callback that is never removed: about 360 000 after five weeks on our instance.
- With the default
allkeys-lruthey compete with the cache and queued jobs for memory (see #14084).
👟 Reproduction steps
-
Self-hosted Appwrite 2.7.2, deploy functions or sites for a while.
-
Count the markers and check their TTL:
docker exec appwrite-redis redis-cli --scan --pattern 'jobs-event-*' | wc -l docker exec appwrite-redis redis-cli ttl "$(docker exec appwrite-redis redis-cli --scan --pattern 'jobs-event-*' | head -1)"
👍 Expected behavior
A marker is removed by Redis after DEDUPE_TTL (3600 s), the window in which the worker uses it.
👎 Actual Behavior
The count only grows, every marker has TTL -1.
Cause: the worker checks a marker with $cache->load($key, self::DEDUPE_TTL) (Jobs.php L180) but stores it with $cache->save($key, true) (L255, L296). The Redis cache adapter only sets EXPIRE when save() gets a TTL; otherwise the envelope only expires logically when it is read. Keys in the format before 2.6.2 (jobs-event-<eventId>, without the project sequence) are never read again and stay as well.
Why it matters: each marker is a small hash (≈ 400 B), but there is one per log, artifact, exit and complete callback of every build. They are never read after an hour, yet they count against maxmemory like the cache and the queues that share the same Redis.
We found no open issue or PR about this.
🎲 Appwrite version
2.7.3 (measured on 2.7.2, code unchanged in 2.7.3)
💻 Operating system
Linux (Ubuntu 26.04), Docker
🧱 Your Environment
Self-hosted, Redis 7.4 with --maxmemory-policy allkeys-lru, shared by cache and queues as in the official compose file.
💡 Suggested fix
- Pass the TTL when saving:
$cache->save($key, true, ttl: self::DEDUPE_TTL)at both places. - Existing installations keep their old markers; a note in the release (or a one-off cleanup in the migration) would help.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find a similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
- 主要言語
- TypeScript
- スター
- 57.9k
- フォーク
- 5.8k
- 平均マージ
- 16時間 1分
- マージ済み PR(30日)
- 768
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
appwrite/appwrite のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
appwrite/appwrite#15707 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Cloud console cannot load details page of function named "Create"再び着手できるかも @priyas1672 が 7 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンproduct / console product / functions
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
appwrite/appwrite#15344 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
/health endpoint documentation missing since v1.9.x再び着手できるかも @shahinsamiur が 20 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンproduct / databases
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
appwrite/appwrite#15005 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
Locale currencies list offers only withdrawn codes for Belarus, Venezuela and Zambia対応中かも @MateenAkram1 が 29 日前に担当しました。 オープンproduct / locale
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
appwrite/appwrite#14627 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Declare the Location header on OAuth2 redirect responses in the OpenAPI spec対応中かも @HarshMN2345 が 41 日前に担当しました。 オープンproduct / auth product / databases product / messaging product / sites sdk / cli
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
appwrite/appwrite の issue をすべて見る
似ている issue
-
agent-ready area: ui-server priority: p3 type: test
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
schlessera/brain-kit#4249 ·
メンテナーはふだん 1 日以内に返信
-
documentation tool triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
can1357/oh-my-pi#19608 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
dependencies tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
bcgov/nr-waste-plus#1549 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
blixvip/solana-token-meta#17 ·
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
blixvip/solana-tx-parse#18 ·