You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "hailin0 (via GitHub)" <gi...@apache.org> on 2025/01/05 14:36:52 UTC
[PR] [Hotfix][Zeta][Log] Fix zeta parallelStream log trace for job [seatunnel]
hailin0 opened a new pull request, #8456:
URL: https://github.com/apache/seatunnel/pull/8456
<!--
Thank you for contributing to SeaTunnel! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
## Contribution Checklist
- Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
- Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
- Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
-->
### 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
### Check list
* [ ] If any new Jar binary package adding in your PR, please add License Notice according
[New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
* [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
* [ ] If you are contributing the connector code, please check that the following files are updated:
1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)
* [ ] Update the [`release-note`](https://github.com/apache/seatunnel/blob/dev/release-note.md).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Hotfix][Zeta][Log] Fix zeta parallelStream log trace for job [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #8456:
URL: https://github.com/apache/seatunnel/pull/8456#discussion_r1903284266
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/tracing/MDCStream.java:
##########
@@ -53,62 +53,69 @@ public MDCStream(MDCContext context, Stream<T> delegate) {
@Override
public Stream<T> filter(Predicate<? super T> predicate) {
- return new MDCStream<>(context, delegate.filter(new MDCPredicate<>(context, predicate)));
+ return new MDCStream<>(
+ context,
+ delegate.filter(new MDCPredicate<>(() -> MDCContext.of(context), predicate)));
Review Comment:
Because element iteration caused repeated execution, it was changed to lazy initialization.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Hotfix][Zeta][Log] Fix zeta parallelStream log trace for job [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #8456:
URL: https://github.com/apache/seatunnel/pull/8456#discussion_r1903284707
##########
seatunnel-api/src/test/java/org/apache/seatunnel/api/tracing/MDCTracerTest.java:
##########
@@ -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()) {
Review Comment:
add testcase
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Hotfix][Zeta][Log] Fix zeta parallelStream log trace for job [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 commented on code in PR #8456:
URL: https://github.com/apache/seatunnel/pull/8456#discussion_r1903289033
##########
seatunnel-api/src/main/java/org/apache/seatunnel/api/tracing/MDCContext.java:
##########
@@ -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;
Review Comment:
cache parent context
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Hotfix][Zeta][Log] Fix zeta parallelStream log trace for job [seatunnel]
Posted by "hailin0 (via GitHub)" <gi...@apache.org>.
hailin0 merged PR #8456:
URL: https://github.com/apache/seatunnel/pull/8456
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org