-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hotfix][Zeta][Log] Fix zeta parallelStream log trace for job #8456
Conversation
return new MDCStream<>(context, delegate.filter(new MDCPredicate<>(context, predicate))); | ||
return new MDCStream<>( | ||
context, | ||
delegate.filter(new MDCPredicate<>(() -> MDCContext.of(context), predicate))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because element iteration caused repeated execution, it was changed to lazy initialization.
@@ -169,58 +171,70 @@ public void testMDCTracedStream() throws Exception { | |||
Assertions.assertNull(MDC.get(MDCContext.PIPELINE_ID)); | |||
Assertions.assertNull(MDC.get(MDCContext.TASK_ID)); | |||
|
|||
tracedStream = MDCTracer.tracing(mdcContext, Arrays.asList(1, 2, 3).stream()); | |||
try (MDCContext ignored = MDCContext.of(1, 2, 3).activate()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add testcase
@@ -44,55 +59,20 @@ public class MDCContext implements Serializable { | |||
private final Long jobId; | |||
private final Long pipelineId; | |||
private final Long taskId; | |||
private transient volatile MDCContext toRestore; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache parent context
Purpose of this pull request
[Zeta][Log] Fix zeta parallelStream log trace for job
Fix #8206
Does this PR introduce any user-facing change?
No
How was this patch tested?
Added
https://github.com/apache/seatunnel/pull/8456/files#diff-40f618a095529aee401bc1ec6f27e378dac5a93d606136cc40d819afae47ec6eR212
Check list
New License Guide
release-note
.