Skip to content

🐛 Fixes Respect Keyboard interrupt #776#777

Draft
jwmatthews wants to merge 5 commits into
konveyor:mainfrom
jwmatthews:ctrl_c_lockup_kantra_issue_776
Draft

🐛 Fixes Respect Keyboard interrupt #776#777
jwmatthews wants to merge 5 commits into
konveyor:mainfrom
jwmatthews:ctrl_c_lockup_kantra_issue_776

Conversation

@jwmatthews

@jwmatthews jwmatthews commented Mar 25, 2026

Copy link
Copy Markdown
Member

Fix Ctrl-C lockup during analysis (#776)

kantra analyze hangs when Ctrl-C is pressed during rule processing,
provider startup, or provider preparation. Multiple independent bugs
prevent signal context cancellation from propagating to blocking
operations.

analyzer-lsp fixes:

  • Buffer engine response channel so workers don't block after handler exits
  • Guard rule dispatch loop with ctx.Done() to prevent deadlock on full channel
  • Buffer ProviderStart abConfigChan and add ctx.Done() to init wait select
  • Add 5s timeout to gRPC provider Stop() (was context.TODO() with no timeout)
  • Thread context through GetProviderClient/NewGRPCClient for signal-aware startup
  • Rewrite checkServicesRunning to accept context and fix broken 30s timeout

kantra fixes:

  • Return immediately after cancelled analysis, skip post-analysis work
  • Use fresh 30s timeout context for env.Stop() cleanup instead of cancelled signal context
  • Add dedicated signal channel for interrupt feedback and second Ctrl-C force-exit

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

fixes #776

Dependent on konveyor/analyzer-lsp#1133

jwmatthews and others added 3 commits March 25, 2026 09:46
Signed-off-by: John Matthews <jwmatthews@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sing

Signed-off-by: John Matthews <jwmatthews@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: John Matthews <jwmatthews@gmail.com>
@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2bc7b8be-3473-419f-b51d-d1e984646d2c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…Chan send instead of buffered channel

Signed-off-by: John Matthews <jwmatthews@gmail.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Mar 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.67%. Comparing base (adf348d) to head (0938958).
⚠️ Report is 38 commits behind head on main.

Files with missing lines Patch % Lines
cmd/analyze/analyze.go 0.00% 17 Missing ⚠️
cmd/analyze/run.go 0.00% 7 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #777      +/-   ##
==========================================
- Coverage   49.93%   49.67%   -0.26%     
==========================================
  Files          53       53              
  Lines        4474     4497      +23     
==========================================
  Hits         2234     2234              
- Misses       1966     1989      +23     
  Partials      274      274              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

  The previous implementation listened on ctx.Done() which also fires
  on normal shutdown via deferred stop(), causing misleading "Interrupt
  received" output and leaked signal state on clean exits. Use a
  dedicated signal.Notify channel so the message only prints on a real
  SIGINT, and an analysisDone channel so the goroutine exits cleanly
  on normal shutdown.

Signed-off-by: John Matthews <jwmatthews@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had any activity for 60 days.
It will remain open for visibility and reporting purposes.
Please comment if this PR is still relevant.

@github-actions github-actions Bot added stale and removed stale labels May 25, 2026
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.

Respect Keyboard interrupt

1 participant