Skip to content

Conversation

@hailin0
Copy link
Member

@hailin0 hailin0 commented Jan 5, 2025

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

return new MDCStream<>(context, delegate.filter(new MDCPredicate<>(context, predicate)));
return new MDCStream<>(
context,
delegate.filter(new MDCPredicate<>(() -> MDCContext.of(context), predicate)));
Copy link
Member Author

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.

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()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add testcase

private final Long jobId;
private final Long pipelineId;
private final Long taskId;
private transient volatile MDCContext toRestore;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache parent context

Hisoka-X
Hisoka-X previously approved these changes Jan 6, 2025
@hailin0 hailin0 merged commit adb656e into apache:dev Jan 7, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants