Skip to content

reqlog: don't divide by zero when longreq_log_freq_sec is 0 - #6174

Open
markhannum wants to merge 1 commit into
bloomberg:mainfrom
markhannum:fix-longreq-divzero
Open

reqlog: don't divide by zero when longreq_log_freq_sec is 0#6174
markhannum wants to merge 1 commit into
bloomberg:mainfrom
markhannum:fix-longreq-divzero

Conversation

@markhannum

Copy link
Copy Markdown
Contributor

reqlog_long_running_clnt() uses gbl_longreq_log_freq_sec as a modulus, but reqlog_log_all_longreqs() only rejected negatives. The tunable is runtime-settable and not READONLY, so setting it to 0 is an integer divide-by-zero in the watchdog thread: one slow query takes the node down.

Treat <= 0 as disabled, matching the gbl_sql_time_threshold check beside it.

Test: longreq_freq_divzero.

@markhannum
markhannum force-pushed the fix-longreq-divzero branch from 9917d3d to 32ff759 Compare August 28, 2026 14:26

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
timepart_retro
unionpar_maxqueue
sc_resume_logicalsc_generated **quarantined**
sc_resume
sc_partial_datacopy
sc_partial_datacopy_logicalsc_generated **quarantined**
sc_datacopy_logicalsc_generated **quarantined**
sc_datacopy
idxexpr_alltypes
timepart_trunc_serialsc_generated

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
sc_constraints
sc_constraints_logicalsc_generated
timepart_retro
unionpar_maxqueue
sc_resume
sc_resume_logicalsc_generated **quarantined**
sc_partial_datacopy
sc_partial_datacopy_logicalsc_generated **quarantined**
sc_datacopy_logicalsc_generated **quarantined**
sc_datacopy

@markhannum
markhannum force-pushed the fix-longreq-divzero branch from 32ff759 to 1c7dc03 Compare August 28, 2026 19:39
reqlog_long_running_clnt() uses the tunable as a modulus, but
reqlog_log_all_longreqs() only rejected negatives, so setting it to 0 took
the watchdog thread down with SIGFPE. Treat <= 0 as disabled.
Adds longreq_freq_divzero.test.

Signed-off-by: Mark Hannum <[email protected]>
@markhannum
markhannum force-pushed the fix-longreq-divzero branch from 1c7dc03 to da1e30f Compare August 28, 2026 19:55

@roborivers roborivers left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cbuild submission: Error ⚠.
Regression testing: Success ✓.

The first 10 failing tests are:
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
reco-ddlk-sql [timeout] **quarantined**

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