lablup / lablup/backend.ai

Apply start_retriable to model_serving background tasks

Open
#6,246 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 model_serving-related background tasks as part of the Redis-based background task migration.

## Acceptance Criteria

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

## Technical Notes

- Review existing model_serving 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
└── model_serving/ # Model serving-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-2691

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.