Use time.monotonic() for duration checks in databricks provider#69758
Open
magic-peach wants to merge 1 commit into
Open
Use time.monotonic() for duration checks in databricks provider#69758magic-peach wants to merge 1 commit into
magic-peach wants to merge 1 commit into
Conversation
Duration and timeout comparisons should use time.monotonic() instead of time.time() to be immune to system clock adjustments (NTP, DST, etc.). This aligns with the project coding standard documented in AGENTS.md. Also fixes a grammar error in a comment: 'important steps; if a query takes to log' -> 'important step; if a query takes too long'. Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Duration and timeout comparisons should use
time.monotonic()instead oftime.time()to be immune to system clock adjustments (NTP, DST, etc.). This aligns with the project coding standard documented in AGENTS.md.Changes:
databricks_base.py: Replacetime.time()withtime.monotonic()in Azure metadata cache TTL checks (both sync and async versions)databricks.pytrigger: Replacetime.time()withtime.monotonic()in the polling loop timeout checkmixins.py: Replacetime.time()withtime.monotonic()in SQL statement execution timeout checks, and fix grammar error in comment ("important steps; if a query takes to log" → "important step; if a query takes too long")Note:
time.time()is correctly retained for token expiry comparisons (lines 337, 378, 640, 1021, 1066) because those compare against wall-clock Unix timestamps received from the Databricks server.Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.7) following the guidelines
Drafted-by: Claude Code (Opus 4.7) (no human review before posting)