phet commented on code in PR #3908:
URL: https://github.com/apache/gobblin/pull/3908#discussion_r1545965610
##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/activity/impl/ProcessWorkUnitImpl.java:
##########
@@ -66,13 +70,36 @@ public class ProcessWorkUnitImpl implements ProcessWorkUnit
{
@Override
public int processWorkUnit(WorkUnitClaimCheck wu) {
+ AutomaticTroubleshooter troubleshooter = null;
+ Optional<EventSubmitter> eventSubmitter =
Optional.ofNullable(wu.getEventSubmitterContext()).map(EventSubmitterContext::create);
try (FileSystem fs = Help.loadFileSystemForce(wu)) {
List<WorkUnit> workUnits = loadFlattenedWorkUnits(wu, fs);
log.info("(M)WU [{}] - loaded; found {} workUnits", wu.getCorrelator(),
workUnits.size());
JobState jobState = Help.loadJobState(wu, fs);
- return execute(workUnits, wu, jobState, fs);
+ log.info("Loaded jobState. Instantiating and starting
troubleshooter...");
+ troubleshooter =
AutomaticTroubleshooterFactory.createForJob(ConfigUtils.propertiesToConfig(jobState.getProperties()));
+ troubleshooter.start();
+ log.info("Finished instantiating troubleshooter. Now executing flow");
+ return execute(workUnits, wu, jobState, fs,
troubleshooter.getIssueRepository());
} catch (IOException | InterruptedException e) {
throw new RuntimeException(e);
+ } finally {
+ try {
+ if (troubleshooter == null) {
+ log.warn("No troubleshooter to report issues from automatic
troubleshooter");
+ } else {
+ log.info("Refining issues and logging summary...");
Review Comment:
let's consistently use a prefix like on line 77, since different WUs may
interleave while processing:
```
log.info("(M)WU [{}] - ... ", wu.getCorrelator(), ...);
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]