mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(glue): report ErrorMessage on workflow graph Crawl entries (#9204)
Carry FinishedCrawl.errorMessage through WorkflowCrawl and include ErrorMessage on CrawlerDetails.Crawls entries in the workflow run graph when present. Follow-up to #9195.
This commit is contained in:
1 parent
84cbee7d6f
commit
fe95e22866
4 files changed
+45
-8
No files matched your search
@@ -231,7 +231,8 @@ public class GlueCrawlerRunService {
|
||||
}
|
||||
|
||||
/** A crawl of a workflow run as the workflow graph reports it: the {@code Crawl} structure. */
|
||||
public record WorkflowCrawl(String crawlerName, String state, Instant startedOn, Instant completedOn) {}
|
||||
public record WorkflowCrawl(String crawlerName, String state, Instant startedOn, Instant completedOn,
|
||||
String errorMessage) {}
|
||||
|
||||
/** The crawls, settled, that belong to a workflow run: finished ones and a crawl still running. */
|
||||
public synchronized List<WorkflowCrawl> crawlsInWorkflowRun(String workflowRunId) {
|
||||
@@ -239,13 +240,14 @@ public class GlueCrawlerRunService {
|
||||
for (CrawlerRunRecord stored : recordStore.scan(key -> true)) {
|
||||
CrawlerRunRecord record = settledRecord(stored.getCrawlerName());
|
||||
if (record.getCurrentStart() != null && workflowRunId.equals(record.getCurrentWorkflowRunId())) {
|
||||
running.add(new WorkflowCrawl(record.getCrawlerName(), STATE_RUNNING, record.getCurrentStart(), null));
|
||||
running.add(new WorkflowCrawl(record.getCrawlerName(), STATE_RUNNING, record.getCurrentStart(), null,
|
||||
null));
|
||||
}
|
||||
}
|
||||
List<WorkflowCrawl> crawls = new ArrayList<>();
|
||||
for (FinishedCrawl crawl : workflowCrawlStore.get(workflowRunId).orElse(List.of())) {
|
||||
crawls.add(new WorkflowCrawl(crawl.getCrawlerName(), crawl.getStatus(), crawl.getStartedAt(),
|
||||
crawl.getFinishedAt()));
|
||||
crawl.getFinishedAt(), crawl.getErrorMessage()));
|
||||
}
|
||||
crawls.addAll(running);
|
||||
crawls.sort(Comparator.comparing(WorkflowCrawl::startedOn));
|
||||
|
||||
@@ -618,6 +618,9 @@ public class GlueTriggerService {
|
||||
if (crawl.completedOn() != null) {
|
||||
entry.put("CompletedOn", EpochSeconds.fromInstant(crawl.completedOn()));
|
||||
}
|
||||
if (crawl.errorMessage() != null) {
|
||||
entry.put("ErrorMessage", crawl.errorMessage());
|
||||
}
|
||||
entry.put("LogGroup", "/aws-glue/crawlers");
|
||||
entry.put("LogStream", name);
|
||||
crawlList.add(entry);
|
||||
|
||||
Reference in new issue
Block a user