Skip to content
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

Fix serialization fo quartz JobExecutionContext #5263

Merged
merged 2 commits into from
Jan 28, 2022

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Jan 28, 2022

Resolves #5243

@laurit laurit requested a review from a team January 28, 2022 10:57
Comment on lines 18 to 21
private static final VirtualField<JobExecutionContext, Context> contextVirtualField =
VirtualField.find(JobExecutionContext.class, Context.class);
private static final VirtualField<JobExecutionContext, Scope> scopeVirtualField =
VirtualField.find(JobExecutionContext.class, Scope.class);
Copy link
Member

Choose a reason for hiding this comment

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

WDYT about making a ContextAndScope class and using just one virtual field?

Comment on lines +125 to +127
// ensure that JobExecutionContext is serializable
try {
new ObjectOutputStream(new ByteArrayOutputStream()).writeObject(context);
Copy link
Member

Choose a reason for hiding this comment

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

👍

@trask trask merged commit 72afa5a into open-telemetry:main Jan 28, 2022
@laurit laurit deleted the quartz-serializable branch January 29, 2022 10:32
RashmiRam pushed a commit to RashmiRam/opentelemetry-auto-instr-java that referenced this pull request May 23, 2022
* Fix serialization fo quartz JobExecutionContext

* address review comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Context and Span are not Serializable and are injected into Quartz Job Data which is Serializable
3 participants