Skip to content

Commit

Permalink
Start using InstigationTick.scheduledExecutionTimestamp when renderin…
Browse files Browse the repository at this point in the history
…g the schedule timeline

Summary:
Right now schedule ticks smush two separate concepts into the 'timestamp' field: the time the schedule tick was supposed to run, and the time it actually ran. This means that if the tick fails and retries, the retry overwrites the original tick in a confusing way, and also means that if a tick happens way after its scheduled time for whatever reason (e..g the daemon was down) the resulting duration is much longer than it should have been.

The plan is to alleviate those issues by moving the 'timestamp' field to be the itme that the tick actually started, and add a new 'scheduledExecutionTimestamp' field for when you when you want to know when it was supposed to happen.

This PR adds the new "scheduledExecutionTimestamp" field to the tick object and uses it where appropriate to keep the existing behavior. I think more substantial design changes will likely need to be made to the schedule timeline view to display both timestamps where appropriate, but wanted to send this out to seed that discussion.
  • Loading branch information
gibsondan committed Jan 3, 2025
1 parent ae401a6 commit 534f6a6
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 16 deletions.
12 changes: 6 additions & 6 deletions js_modules/dagster-ui/packages/ui-core/client.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const TICK_TAG_FRAGMENT = gql`
id
status
timestamp
scheduledExecutionTimestamp
skipReason
runIds
runKeys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export const HISTORY_TICK_FRAGMENT = gql`
status
timestamp
endTimestamp
scheduledExecutionTimestamp
cursor
instigationType
skipReason
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ const TickDetailsDialogImpl = ({tickId, tickResultType, instigationSelector}: In
<>
<span>Tick for {instigationSelector.name}: </span>
<TimestampDisplay
timestamp={tick.timestamp}
timestamp={tick.scheduledExecutionTimestamp ?? tick.timestamp}
timeFormat={{showTimezone: false, showSeconds: true}}
/>
</>
Expand Down Expand Up @@ -242,7 +242,10 @@ export function TickDetailSummary({
<Subtitle2>Timestamp</Subtitle2>
<div>
{tick ? (
<Timestamp timestamp={{unix: tick.timestamp}} timeFormat={{showTimezone: true}} />
<Timestamp
timestamp={{unix: tick.scheduledExecutionTimestamp ?? tick.timestamp}}
timeFormat={{showTimezone: true}}
/>
) : (
'–'
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ function TickRow({
<tr>
<td>
<TimestampDisplay
timestamp={tick.timestamp}
timestamp={tick.scheduledExecutionTimestamp ?? tick.timestamp}
timeFormat={{showTimezone: false, showSeconds: true}}
/>
</td>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const ScheduleDetails = (props: {
{latestTick ? (
<Group direction="row" spacing={8} alignItems="center">
<TimestampDisplay
timestamp={latestTick.timestamp}
timestamp={latestTick.scheduledExecutionTimestamp}
timezone={executionTimezone}
timeFormat={TIME_FORMAT}
/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 534f6a6

Please sign in to comment.