Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GH-1465] Specify TDR Polling Interval #542

Merged
merged 11 commits into from
Dec 6, 2021

Conversation

rfricke-asymmetrik
Copy link
Contributor

Purpose

Currently the polling interval for a Terra DataRepo Source is 20 minutes. This could be too long for some cases and certainly makes the system tests run long. This PR allows the workload creator to specify a polling interval and defaults to 20 minutes if it is not provided.

https://broadinstitute.atlassian.net/browse/GH-1465

Changes

  • Add polling_interval column to TerraDataRepoSource table
  • Add pollingInterval to spec
  • Check for the existence of pollingInterval when deciding whether to check for a snapshot

Review Instructions

Run the system test for test-workload-sink-outputs-to-tdr

@rfricke-asymmetrik rfricke-asymmetrik marked this pull request as ready for review November 23, 2021 19:20
@okotsopoulos okotsopoulos self-requested a review November 24, 2021 15:52
Copy link
Contributor

@okotsopoulos okotsopoulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing this! Two additional pieces of feedback:

  • pollingInterval / polling_interval without the unit of measurement is ambiguous. My preference is to make explicit reference in naming so that there's no question of how the value is interpreted, ex. pollingIntervalMinutes / polling_interval_minutes but this may be subjective.
  • Please also update the GitHub docs to reflect this new configuration.


(defn ^:private tdr-source-should-poll?
"Return true if it's been at least `tdr-source-polling-interval-minutes`
"Return true if it's been at least the specified `polling_interval` or, if unspecified, `tdr-source-default-polling-interval-minutes`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: easier to read if broken up with max 80 chars per line. Ex.

  "Return true if it's been at least the specified `polling_interval`
   or, if unspecified, `tdr-source-default-polling-interval-minutes`
   since `last_checked` -- when we last checked for new rows in the TDR."

runInTransaction="false">
<comment>
We want to be able to allow each terra data repo source to be able to specify
the rate in which they poll for a new snapshot. The new column added to TerraDataRepoSource
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest rewording:
"the rate in which they poll for a new snapshot"

To:
"the rate at which they poll TDR for new rows to snapshot"

Comment on lines 317 to 319
(let [checked (timestamp-to-offsetdatetime last_checked)
minutes-since-poll (.between ChronoUnit/MINUTES checked utc-now)]
minutes-since-poll (.between ChronoUnit/MINUTES checked utc-now)
polling-interval (or pollingInterval tdr-source-default-polling-interval-minutes)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style nit: it's a bit easier to read when we align the assignments.

  (let [checked            (timestamp-to-offsetdatetime last_checked)
        minutes-since-poll (.between ChronoUnit/MINUTES checked utc-now)
        polling-interval   (or pollingInterval
                               tdr-source-default-polling-interval-minutes)]

@@ -95,6 +97,11 @@ The email addresses of those whom should be "readers" of all snapshots created
by workflow-launcher in this workload. You can specify individual users and/or
Terra/Firecloud groups.

#### `pollingIntervalMinutes`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@okotsopoulos okotsopoulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay in approval, I thought I had done so already.

@rfricke-asymmetrik rfricke-asymmetrik merged commit 6340744 into develop Dec 6, 2021
@rfricke-asymmetrik rfricke-asymmetrik deleted the rfricke/GH-1465-TDRPolling branch December 6, 2021 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants