[
https://issues.apache.org/jira/browse/GOBBLIN-2097?focusedWorklogId=924033&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-924033
]
ASF GitHub Bot logged work on GOBBLIN-2097:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 23/Jun/24 19:39
Start Date: 23/Jun/24 19:39
Worklog Time Spent: 10m
Work Description: umustafi commented on code in PR #3984:
URL: https://github.com/apache/gobblin/pull/3984#discussion_r1650169783
##########
gobblin-service/src/main/java/org/apache/gobblin/service/modules/orchestration/FlowLaunchHandler.java:
##########
@@ -275,6 +276,27 @@ public static JobDataMap
updatePropsInJobDataMap(JobDataMap jobDataMap,
return jobDataMap;
}
+ public static JobDataMap deepCopyJobDataMap(JobDataMap original) {
+ JobDataMap copy = new JobDataMap();
+ for (Map.Entry<String, Object> entry : original.entrySet()) {
+ // Assuming all values stored in the JobDataMap are serializable
+ Object value = entry.getValue();
+ if(value instanceof Properties) {
+ value = deepCopyProperties((Properties) value);
+ }
+ copy.put(entry.getKey(), value);
Review Comment:
I tried to make deep copy with `new String()` for every key and value but it
does not pass the `Assert.assertNotSame(originalJobDataMap.get("key"),
newJobDataMap.get("key"));`. All the of the values are copied over unchanged.
Only one new key (`isReminder`) is added to the new `jobDataMap` and new
`Properties` obj created. As long as the objects themselves are different, the
original job schedules will not be affected by a new key in the reminder object.
Issue Time Tracking
-------------------
Worklog Id: (was: 924033)
Remaining Estimate: 0h
Time Spent: 10m
> Use unique JobDataMaps and Properties to use for reminder events
> ----------------------------------------------------------------
>
> Key: GOBBLIN-2097
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2097
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-service
> Reporter: Urmi Mustafi
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> We notice that after deploying the service all subsequent scheduler triggers
> after the very first one are incorrectly marked as reminders even when they
> are for "original" events. This is a result of re-using the same JobDataMap
> and Properties object between the original and reminder Jobs for the
> Scheduler. The following changes create deep copies of both to use for the
> reminders so adding a reminder flag in one will not affect the other.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)