[
https://issues.apache.org/jira/browse/GOBBLIN-1880?focusedWorklogId=876637&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-876637
]
ASF GitHub Bot logged work on GOBBLIN-1880:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 16/Aug/23 20:23
Start Date: 16/Aug/23 20:23
Worklog Time Spent: 10m
Work Description: Will-Lo commented on PR #3742:
URL: https://github.com/apache/gobblin/pull/3742#issuecomment-1681222332
What would the user experience be if they added an invalid Cron? I think we
want to ensure that the user receives an errorcode 400 as well as some
information as to what the issue is with their cron. Potentially see
`flowSpec.addCompilationError` for how this is handled. Alternatively, consider
adding this check in `BaseFlowToJobSpecCompiler`, which is extended by other
compilers in GaaS, because it already sort of tries to handle this, but is
missing your additional checks to ensure that the schedule is actually valid.
```
if (flowSpecProperties.containsKey(ConfigurationKeys.JOB_SCHEDULE_KEY)
&& StringUtils.isNotBlank(
flowSpecProperties.getProperty(ConfigurationKeys.JOB_SCHEDULE_KEY)))
{
try {
new
CronExpression(flowSpecProperties.getProperty(ConfigurationKeys.JOB_SCHEDULE_KEY));
} catch (Exception e) {
log.error("invalid cron schedule: {}",
flowSpecProperties.getProperty(ConfigurationKeys.JOB_SCHEDULE_KEY), e);
flowSpec.getCompilationErrors().add(new FlowSpec.CompilationError(0,
"invalid cron schedule: " +
flowSpecProperties.getProperty(ConfigurationKeys.JOB_SCHEDULE_KEY) +
e.getMessage()));
return null;
}
```
https://github.com/apache/gobblin/blob/69d7e0fa4df2499934462854514ddc9ddbfe7dc7/gobblin-service/src/main/java/org/apache/gobblin/service/modules/flow/BaseFlowToJobSpecCompiler.java#L185
Issue Time Tracking
-------------------
Worklog Id: (was: 876637)
Time Spent: 40m (was: 0.5h)
> Handle Invalid Cron Schedules for Gobblin Scheduler
> ---------------------------------------------------
>
> Key: GOBBLIN-1880
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1880
> Project: Apache Gobblin
> Issue Type: New Feature
> Reporter: Meeth Gala
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)