Skip to content

1223: Warn when web and database server time differ#7815

Merged
labkey-nicka merged 5 commits into
release26.7-SNAPSHOTfrom
26.7_fb_time_diff_1223
Jul 9, 2026
Merged

1223: Warn when web and database server time differ#7815
labkey-nicka merged 5 commits into
release26.7-SNAPSHOTfrom
26.7_fb_time_diff_1223

Conversation

@labkey-nicka

@labkey-nicka labkey-nicka commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Rationale

This addresses #1223 by adding a configuration warning when the web server and database server times differ.

Related Pull Requests

Changes

  • Introduce SqlDialect.getServerDatabaseTimeDifference() to centralize logic for checking time difference
  • Capture results in ServerDatabaseTimeDifference record
  • Add configuration warning for Postgres
  • Update admin page and experiment material to use new logic
  • Refactor usages of unsafe()

@labkey-nicka labkey-nicka requested a review from labkey-adam July 6, 2026 21:22
@labkey-nicka labkey-nicka self-assigned this Jul 6, 2026
Comment thread experiment/src/org/labkey/experiment/api/ExpMaterialTableImpl.java
_incrementalUpdateDisabled = deltaSeconds > thresholdSeconds;
DbScope scope = DbScope.getLabKeyScope();
SqlDialect.ServerDatabaseTimeDifference difference = SqlDialect.getServerDatabaseTimeDifference(scope);
_incrementalUpdateDisabled = difference.exceedsWarningThreshold();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only way to reset this is to restart that web server, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes. This check is run often. Hopefully, the times being different is a rare occurrence and something that should be addressed.

@labkey-nicka labkey-nicka force-pushed the 26.7_fb_time_diff_1223 branch from d2fcdb2 to a0032b0 Compare July 9, 2026 16:28
@labkey-nicka labkey-nicka merged commit cfa8cf7 into release26.7-SNAPSHOT Jul 9, 2026
6 of 13 checks passed
@labkey-nicka labkey-nicka deleted the 26.7_fb_time_diff_1223 branch July 9, 2026 16: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