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

bump chainlink-common for SLOW QUERY log updates and custom thresholds #13358

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

jmank88
Copy link
Contributor

@jmank88 jmank88 commented May 29, 2024

https://smartcontract-it.atlassian.net/browse/BCF-3245

New version understand the difference between cancellation and a missed deadline.

https://smartcontract-it.atlassian.net/browse/BCF-3252

Use custom thresholds to reduce noisy logs when we expect to use most of a timeout.

Requires:

Copy link
Contributor

I see you updated files related to core. Please run pnpm changeset in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@jmank88 jmank88 force-pushed the BCF-3245-slow-query-logs branch from 1251422 to 99b45e5 Compare June 5, 2024 00:31
@jmank88 jmank88 force-pushed the BCF-3245-slow-query-logs branch from 99b45e5 to 7bd99d9 Compare June 5, 2024 00:34
@jmank88 jmank88 force-pushed the BCF-3245-slow-query-logs branch from 7bd99d9 to affd637 Compare June 5, 2024 14:40
@jmank88 jmank88 changed the title bump chainlink-common for SLOW QUERY log updates bump chainlink-common for SLOW QUERY log updates and custom thresholds Jun 5, 2024
Comment on lines +225 to +231
overtimeThresholds = sqlutil.LogThresholds{
Warn: func(timeout time.Duration) time.Duration {
return timeout - (timeout / 5) // 80%
},
Error: func(timeout time.Duration) time.Duration {
return timeout - (timeout / 10) // 90%
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These adjusted thresholds are somewhat arbitrary - do they seem OK? For reference the defaults are 10%/20%.

@@ -235,6 +245,7 @@ func init() {
// overtimeContext returns a modified context for overtime work, since tasks are expected to keep running and return
// results, even after context cancellation.
func overtimeContext(ctx context.Context) (context.Context, context.CancelFunc) {
ctx = overtimeThresholds.ContextWithValue(ctx)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps this should only apply to the deadline case? Because we have a longer default timeout otherwise

@jmank88 jmank88 force-pushed the BCF-3245-slow-query-logs branch from 3dd590d to 0dd836c Compare June 5, 2024 18:19
@jmank88 jmank88 marked this pull request as ready for review June 5, 2024 18:19
@jmank88 jmank88 requested review from a team as code owners June 5, 2024 18:19
@jmank88 jmank88 enabled auto-merge June 5, 2024 19:52
@jmank88 jmank88 added this pull request to the merge queue Jun 5, 2024
Merged via the queue into develop with commit 58420d6 Jun 5, 2024
105 of 106 checks passed
@jmank88 jmank88 deleted the BCF-3245-slow-query-logs branch June 5, 2024 20:23
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.

4 participants