lablup / lablup/backend.ai

Apply start_retriable to artifacts background tasks

Open
#6,247 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Overview

Apply the `start_retriable` pattern to artifacts-related background tasks as part of the Redis-based background task migration.

## Acceptance Criteria

- All artifacts background tasks use `start_retriable` for retry logic
- Consistent error handling and retry behavior across artifacts tasks
- Tests verify retry mechanism works correctly

## Technical Notes

- Review existing artifacts background task implementations
- Replace current retry mechanisms with `start_retriable`
- Ensure proper error handling and logging

## Implementation Structure

Follow the same structure as `src/ai/backend/storage/bgtask`:

```
src/ai/backend/manager/bgtask/
├── __init__.py
├── registry.py # BgtaskHandlerRegistryCreator - register all handlers
├── tags.py # Task tag constants (if needed)
└── tasks/ # Individual task handler modules
├── __init__.py
└── artifacts/ # Artifacts-related task handlers
└── {task_name}.py
```

**Task Handler Pattern:**

- Define `Args` class inheriting `BaseBackgroundTaskArgs`
- Define `Handler` class inheriting `BaseBackgroundTaskHandler[ArgsType]`
- Implement `name()`, `args_type()`, `execute()` methods
- Register handlers in `registry.py`

JIRA Issue: BA-2692

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.