[
https://issues.apache.org/jira/browse/GOBBLIN-2030?focusedWorklogId=912417&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-912417
]
ASF GitHub Bot logged work on GOBBLIN-2030:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 01/Apr/24 05:11
Start Date: 01/Apr/24 05:11
Worklog Time Spent: 10m
Work Description: phet commented on code in PR #3908:
URL: https://github.com/apache/gobblin/pull/3908#discussion_r1545961042
##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/work/EagerFsDirBackedWorkUnitClaimCheckWorkload.java:
##########
@@ -30,15 +34,17 @@
@lombok.NoArgsConstructor // IMPORTANT: for jackson (de)serialization
@lombok.ToString(callSuper = true)
public class EagerFsDirBackedWorkUnitClaimCheckWorkload extends
AbstractEagerFsDirBackedWorkload<WorkUnitClaimCheck> {
+ private EventSubmitterContext eventSubmitterContext;
Review Comment:
`final`?
##########
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);
Review Comment:
`ofNullable`? wasn't there `@NonNull` annotation on that member?
##########
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...");
+ troubleshooter.refineIssues();
+ troubleshooter.logIssueSummary();
+ if (eventSubmitter.isPresent()) {
Review Comment:
AFAICT this shouldn't be `Optional` - see earlier comment
##########
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:
```
log.info("(M)WU [{}] - ... ", wu.getCorrelator(), ...);
```
##########
gobblin-temporal/src/main/java/org/apache/gobblin/temporal/ddm/work/EagerFsDirBackedWorkUnitClaimCheckWorkload.java:
##########
@@ -30,15 +34,17 @@
@lombok.NoArgsConstructor // IMPORTANT: for jackson (de)serialization
@lombok.ToString(callSuper = true)
public class EagerFsDirBackedWorkUnitClaimCheckWorkload extends
AbstractEagerFsDirBackedWorkload<WorkUnitClaimCheck> {
Review Comment:
unclear whether the `EventSubmitterContext` should stay here or actually
belongs better in the base class... how did you decide? I'll probably need to
finish reading the impl and reflect on it to form an opinion...
##########
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");
Review Comment:
is there really value in `.info` level debugging? won't exception logging
let us know where something went wrong (following line 77's logging)?
Issue Time Tracking
-------------------
Worklog Id: (was: 912417)
Time Spent: 0.5h (was: 20m)
> Integrate new AutoTroubleshooter with GaaS
> ------------------------------------------
>
> Key: GOBBLIN-2030
> URL: https://issues.apache.org/jira/browse/GOBBLIN-2030
> Project: Apache Gobblin
> Issue Type: Improvement
> Reporter: Matthew Ho
> Priority: Major
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)