-
Notifications
You must be signed in to change notification settings - Fork 0
Djt/0111/spanname #26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 { |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
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).
| if err != nil { | |
| if err != nil && log != nil { |
| // If the status is not 'released', log a warning | ||
| if status != "released" { |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
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'.
| // 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" { |
| result = errors.Join(result, releaseErr) | ||
| } | ||
|
|
||
| // If the status is not 'released', log a warning |
Copilot
AI
Jan 13, 2026
There was a problem hiding this comment.
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.
| // If the status is not 'released', log a warning | |
| // If the status is not 'released', record this in the result error |
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