<fix>[thread]: guard Context.current() with telemetry check to prevent MN startup crash#3364
Closed
zstack-robot-2 wants to merge 1 commit into5.5.6from
Closed
<fix>[thread]: guard Context.current() with telemetry check to prevent MN startup crash#3364zstack-robot-2 wants to merge 1 commit into5.5.6from
zstack-robot-2 wants to merge 1 commit into5.5.6from
Conversation
SyncTaskFuture constructor calls Context.current() unconditionally, which triggers ServiceLoader for ContextStorageProvider even when telemetry is disabled. If sentry-opentelemetry-bootstrap jar is on classpath, ServiceLoader fails with "not a subtype" due to ClassLoader isolation in Tomcat, throwing ServiceConfigurationError (extends Error) that escapes all catch(Exception) blocks and crashes MN startup. Fix: only call Context.current() when telemetry is enabled, matching the existing pattern used in other DispatchQueueImpl code paths. Change-Id: I8ae1f790c8591ae7acebd011319878eb824d2fb0
|
No actionable comments were generated in the recent review. 🎉 概览在 SyncTaskFuture 构造器中修改了 parentContext 的赋值逻辑,使其根据遥测启用状态进行条件判断:遥测启用时设为 Context.current(),否则设为 null。 变更
预估代码审查工作量🎯 1 (微小) | ⏱️ ~3 分钟 诗
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves ZSTAC-82274. DispatchQueueImpl.SyncTaskFuture calls Context.current() unconditionally in constructor, triggering ServiceLoader for ContextStorageProvider even when telemetry is disabled. This causes ServiceConfigurationError when sentry-opentelemetry-bootstrap jar has ClassLoader conflicts in Tomcat.
sync from gitlab !9199