Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix: keep EKS nodes up after end_date while submissions are pending - #5187

Draft
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-management-24c2
Draft

Fix: keep EKS nodes up after end_date while submissions are pending#5187
cursor[bot] wants to merge 1 commit into
masterfrom
cursor/critical-bug-management-24c2

Conversation

@cursor

@cursor cursor Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

scripts/lambda/auto_scale_eks_nodes_lambda.py treated a past end_date as an unconditional scale-to-zero signal via _should_force_scale_down, even when pending_submissions > 0. That undoes the pending-aware drain policy from #5179/#5185 for code-upload challenges: event-driven and sweep invocations zeroed the nodegroup, killing in-flight pods and leaving queued work without capacity.

This is the same failure mode as #5185 (monitoring cron scripts), but in the production EKS Lambda path that #5185 does not cover.

Trigger scenario

  1. A docker-based / code-upload challenge reaches end_date with submissions still queued/running/resuming.
  2. A submission lifecycle event or scheduled sweep invokes auto_scale_eks_nodes_lambda.
  3. Old _should_force_scale_down returned True because end_date <= now.
  4. Lambda set desiredSize=0 regardless of pending count.
  5. EKS nodes scale to zero → pods terminated → remaining queue has no consumers.

Changes

  • _should_force_scale_down now returns True only for is_disabled challenges.
  • Ended challenges keep (or scale up) nodes until pending_submissions == 0, then the normal idle path zeros the nodegroup.
  • Regression tests cover ended+pending drain, ended+idle scale-down, and the helper contract.

Test plan

  • python3 -m unittest tests.unit.lambda.test_auto_scale_eks_nodes_lambda -v — 24 passed
  • black --check --line-length=79 / isort --check --profile=black --line-length=79 on changed files
Open in Web View Automation 

…ding

The EKS node autoscale Lambda treated end_date as an unconditional
zero-nodes signal via _should_force_scale_down, so event-driven and
sweep invocations killed code-upload capacity even with queued/running
submissions still draining. Only is_disabled now forces scale-to-zero;
ended challenges keep (or scale up) nodes until pending_submissions is 0.

Co-authored-by: Rishabh Jain <[email protected]>
@codecov

codecov Bot commented Aug 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.30%. Comparing base (b269a39) to head (706f4af).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5187   +/-   ##
=======================================
  Coverage   91.30%   91.30%           
=======================================
  Files         115      115           
  Lines        8996     8996           
=======================================
  Hits         8214     8214           
  Misses        782      782           
Flag Coverage Δ
backend 93.85% <ø> (ø)
frontend 87.54% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Accounts & Authentication 97.40% <ø> (ø)
Challenges Management 96.19% <ø> (ø)
Job Processing 90.19% <ø> (ø)
Participants & Teams 99.54% <ø> (ø)
Challenge Hosts 100.00% <ø> (ø)
Analytics 100.00% <ø> (ø)
Web Interface 100.00% <ø> (ø)
Frontend (Gulp) 87.54% <ø> (ø)
All Models 97.37% <ø> (ø)
All Views 100.00% <ø> (ø)
All Serializers 98.20% <ø> (ø)
Utility Functions 97.30% <ø> (ø)
Core Configuration 78.94% <ø> (ø)

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b269a39...706f4af. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 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