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
ISPN-14144 Propagate subject in task execution #10336
ISPN-14144 Propagate subject in task execution #10336
Conversation
server/runtime/src/main/java/org/infinispan/server/tasks/TaskContextAdapter.java
Outdated
Show resolved
Hide resolved
private Optional<Map<String, ?>> parameters = Optional.empty(); | ||
private Optional<Subject> subject = Optional.empty(); | ||
private boolean logEvent; | ||
private transient EmbeddedCacheManager cacheManager; |
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.
Why do we need the transient
keyword, the class isn't Serializable
and doesn't need to be.
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.
I know, but it is a nice way to mark the fields
@@ -30,14 +26,14 @@ | |||
@ProtoField(2) | |||
final String cacheName; | |||
|
|||
@ProtoField(number = 3, collectionImplementation = ArrayList.class) | |||
final List<TaskParameter> parameters; | |||
@ProtoField(3) |
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.
The correct way to handle this is to use a new field. Ideally we would just be able to add @ProtoReservice(value=3)
to the class and proto.lock
checks would pass. However, the reserved
statement is currently commented due to a limitation in the protostream proto parser infinispan/protostream#174.
Adding @ProtoReservice(value=3)
will still prevent the field being used in the ProtoField
though.
A workaround to keep proto compatibility would be todo the following:
@ProtoField(1)
final String taskName;
@ProtoField(2)
final String cacheName;
@ProtoField(number = 3, collectionImplementation = ArrayList.class)
List<TaskParameter> parameters;
@ProtoField(4)
final TaskContext context;
@ProtoFactory
DistributedServerTask(String taskName, String cacheName, List<TaskParameter> parameters, TaskContext context) {
this(taskName, cacheName, context);
}
public DistributedServerTask(String taskName, String cacheName, TaskContext context) {
this.cacheName = cacheName;
this.taskName = taskName;
this.context = context;
}
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.
This is for internal invocation only, so I'm not fussed about losing backwards compat.
a211d67
to
78d6c5b
Compare
|
78d6c5b
to
3e0d775
Compare
Should be fixed. The |
Thanks @tristantarrant |
https://issues.redhat.com/browse/ISPN-14144
Properly fix this