Skip to content

fix: cancel in-flight GetCircularDependencies request when GetGraph fails#80

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-78-20260227-1022
Feb 27, 2026
Merged

fix: cancel in-flight GetCircularDependencies request when GetGraph fails#80
claude[bot] merged 1 commit intomainfrom
claude/issue-78-20260227-1022

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Feb 27, 2026

Summary

When GetGraph fails in fetchGraphWithCircularDeps, the in-flight HTTP request to the circular-dependencies API endpoint continued running to completion even though its result would be discarded. While there was no goroutine leak (the channel is buffered), this wasted network bandwidth and API quota.

Changes

  • Added ctx, cancel := context.WithCancel(ctx) and defer cancel() at the top of fetchGraphWithCircularDeps in cmd/run.go.
  • When GetGraph fails and the function returns early, defer cancel() fires, aborting the in-flight GetCircularDependencies HTTP request immediately.

Fixes #78

Generated with Claude Code

…ails

Derive a cancellable context at the top of fetchGraphWithCircularDeps and
use defer cancel() so that the in-flight HTTP request to the circular-
dependencies API endpoint is aborted as soon as GetGraph returns an error,
avoiding wasted network bandwidth and API quota.

Fixes #78

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit 38bf5e9 into main Feb 27, 2026
1 check passed
@claude claude bot deleted the claude/issue-78-20260227-1022 branch February 27, 2026 10:30
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.

GetCircularDependencies HTTP request not cancelled when GetGraph fails

0 participants