Skip to content

Defer command execution during long-running scripts#3363

Open
amanosme wants to merge 3 commits intovalkey-io:unstablefrom
amanosme:defer-clients
Open

Defer command execution during long-running scripts#3363
amanosme wants to merge 3 commits intovalkey-io:unstablefrom
amanosme:defer-clients

Conversation

@amanosme
Copy link
Copy Markdown
Contributor

@amanosme amanosme commented Mar 13, 2026

Addressing open issue #3218

This PR changes the default response to command execution after busy-reply-threshold is exceeded, where the issuing client will be blocked (and added to postponed client list) until the script is through executing.

I chose to leave the logic for FUNCTION STATS unchanged, where the command will still return -BUSY error for EVAL scripts. It seemed to me that we intentionally don't want to show function stats for EVAL, but I can remove these lines if we decide otherwise.

Most of the changes were to adjust how tests check that a script is timed out- we verify -BUSY response to FUNCTION STATS for EVAL scripts, and for functions we use FUNCTION STATS to check how long the script has been running. This also changes the expected behavior for MULTI transactions sent during timeout, where we expect all transactions to execute once we issue SCRIPT KILL/ FUNCTION KILL, so the multi tests were updated accordingly.

amanosme and others added 2 commits March 13, 2026 14:38
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.51%. Comparing base (ac5e44c) to head (fe7ef8e).
⚠️ Report is 1 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #3363      +/-   ##
============================================
- Coverage     74.53%   74.51%   -0.03%     
============================================
  Files           130      130              
  Lines         72731    72730       -1     
============================================
- Hits          54208    54192      -16     
- Misses        18523    18538      +15     
Files with missing lines Coverage Δ
src/script.c 89.30% <100.00%> (+0.06%) ⬆️
src/server.c 89.57% <100.00%> (+0.02%) ⬆️

... and 17 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant