Skip to content

Conversation

@djthorpe
Copy link
Member

@djthorpe djthorpe commented Jan 13, 2026

This pull request modifies task execution and error handling in the queue manager. The changes simplify span naming and add status checking after task release, but contain critical bugs that need to be addressed.

Changes:

Simplified OpenTelemetry span names for tasks by removing individual task IDs
Added error logging for failed tasks in the task loop
Added status checking after task release to detect non-"released" states

Copilot AI review requested due to automatic review settings January 13, 2026 08:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modifies task execution and error handling in the queue manager. The changes simplify span naming and add status checking after task release, but contain critical bugs that need to be addressed.

Changes:

  • Simplified OpenTelemetry span names for tasks by removing individual task IDs
  • Added error logging for failed tasks in the task loop
  • Added status checking after task release to detect non-"released" states

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if err := manager.RunTaskLoop(ctx, func(ctx context.Context, task *schema.Task) error {
return manager.runTaskWorker(ctx, task, manager.tracer)
err := manager.runTaskWorker(ctx, task, manager.tracer)
if err != nil {
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log variable may be nil, which would cause a panic when calling log.With. Add a nil check before using the logger, similar to the pattern used elsewhere in this file (see lines 106-111).

Suggested change
if err != nil {
if err != nil && log != nil {

Copilot uses AI. Check for mistakes.
Comment on lines +233 to +234
// If the status is not 'released', log a warning
if status != "released" {
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic incorrectly treats all non-"released" statuses as errors. According to the database schema, valid task statuses include 'expired', 'new', 'failed', 'retry', 'retained', 'released', and 'unknown'. Status 'retry' is a valid outcome when a task is being retried and should not be treated as an error. Consider checking for explicitly problematic statuses (e.g., 'failed', 'expired') rather than checking for the absence of 'released'.

Suggested change
// If the status is not 'released', log a warning
if status != "released" {
// Only treat explicitly problematic statuses as errors
if status == "failed" || status == "expired" || status == "unknown" {

Copilot uses AI. Check for mistakes.
result = errors.Join(result, releaseErr)
}

// If the status is not 'released', log a warning
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment says "log a warning" but the code creates an error instead. Either the comment should be updated to match the implementation, or the implementation should use a logging approach instead of creating an error.

Suggested change
// If the status is not 'released', log a warning
// If the status is not 'released', record this in the result error

Copilot uses AI. Check for mistakes.
@djthorpe djthorpe merged commit c751087 into main Jan 13, 2026
1 check passed
@djthorpe djthorpe deleted the djt/0111/spanname branch January 13, 2026 08:26
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.

2 participants