Use ScopedValue when available for thread context
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- java
- 領域
- backend, performance
調査の方向性
The work centres on the ThreadContext lookup, which currently falls back to a ThreadLocal when Java code calls into JRuby. Start by finding where ThreadContext is obtained and every place ThreadLocal is used for it, then check how an optional ScopedValue path could be gated on the API being available (Java 25, or 21 with preview). Done means a feature-flagged path that reads the context through ScopedValue, with the ThreadLocal fallback still working. Expect design questions about rollout first, so ask the maintainers before coding.
索引モデルが issue の本文から書いたものです。
説明
ScopedValue, finalized in Java 25, provides a fast, JIT-friendly way to access values scoped to a given thread, similar to ThreadLocal values but without many of their shortcomings.
We currently use ThreadLocal in a number of places, but most notably for accessing the current ThreadContext for a given thread. Over the years, we have worked to propagate this value through our own call stacks, including through core methods and JIT-compiled code, but we still must fall back on a ThreadLocal whenever calling into JRuby from external code like Java libraries.
By modifying our ThreadContext management to use a ScopedValue, we can start to provide a fast path for Java 25+ users to reach the context without traversing a ThreadLocal. Eventually we will require Java 25 minimum and nearly all context accesses will be through ScopedValue.
This process should start in JRuby 10.1.x as an optional feature only available when the ScopedValue API is accessible. It should be automatically available in Java 25, and might also possibly be available in 21 with preview features turned on. We will need to evaluate whether that is functional enough to allow use prior to the full support in 25.
- 主要言語
- Ruby
- スター
- 3.9k
- フォーク
- 951
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 97
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
jruby/jruby のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
ffi stdlib
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
[Bug] Chatwoot v4.19.0 – Super Admin returns 500 due to missing superadmin.scss Vite manifest entryオープンBug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
internal
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Kong/developer.konghq.com#7716 ·
メンテナーはふだん 1 日以内に返信
-
maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
geeksforsocialchange/PlaceCal#3676 ·
メンテナーはふだん 1 日以内に返信