Skip to content

[plan] Improve concurrency implementation with conc library enhancements #8615

@github-actions

Description

@github-actions

Overview

This tracking issue implements improvements to gh-aw's usage of the sourcegraph/conc library for concurrent artifact downloading, based on findings from the Go Fan review.

Source: Discussion #8587

Current State

The project currently uses conc for concurrent artifact downloading in pkg/cli/logs_orchestrator.go with:

  • ✅ Scoped concurrency with pool.NewWithResults[DownloadResult]()
  • ✅ Bounded concurrency via WithMaxGoroutines(MaxConcurrentDownloads)
  • ✅ Automatic panic recovery
  • ✅ Type-safe result collection

Planned Improvements

High Priority

  1. Add context cancellation support - Enable graceful shutdown on Ctrl+C for long-running downloads
  2. Document concurrency decisions - Explain configuration choices and behavior guarantees

Medium Priority

  1. Add concurrent download test coverage - Test panic recovery, result ordering, and resource cleanup
  2. Document panic behavior - Clarify automatic panic recovery for code reviewers

Lower Priority

  1. Make concurrency limits configurable - Allow tuning based on system resources and API limits

Benefits

  • 🎯 Better user experience: Graceful cancellation of long-running operations
  • 📚 Improved maintainability: Clear documentation of concurrency decisions
  • 🛡️ Regression prevention: Comprehensive test coverage for concurrent behavior
  • ⚙️ Flexibility: Configurable concurrency based on environment

Related Resources

  • sourcegraph/conc GitHub
  • Current usage: pkg/cli/logs_orchestrator.go:481
  • Module summary: specs/mods/sourcegraph-conc.md

AI generated by Plan Command for discussion #8587

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions