[BUG]: wait_for_ollama() Retries Indefinitely When Ollama Is Unavailable

Đang mở Phù hợp với người mới
#56 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@SYED-IRTEZA-HUSSAIN-RIZVI đang làm issue này rồi.

Từ ngày 9/11/2026.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
ollama, python
Lĩnh vực
ai, backend

Hướng nghiên cứu

Bắt đầu trong bot.py tại wait_for_ollama() và theo dõi cách trình xử lý sự kiện on_ready() xử lý các lỗi và giá trị trả về của hàm này. Thêm thời gian chờ có giới hạn cùng cách xử lý lỗi phù hợp, sau đó xác minh rằng quá trình khởi động có thể tiếp tục hoặc báo cáo dịch vụ Ollama không khả dụng khi đạt đến giới hạn.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug enhancement
Bug Description

The wait_for_ollama() function in bot.py contains an unconditional while True loop that continuously checks whether the Ollama service is available.

When Ollama is unavailable, unreachable, or fails to return a successful response, the function catches the request error, waits for 10 seconds, and retries again. However, there is no maximum retry count or overall timeout to stop this process.

Since wait_for_ollama() is called from the Discord bot's on_ready() event handler, the bot's readiness workflow can remain blocked indefinitely while Ollama is unavailable.

As a result, subsequent operations within on_ready(), including the backlog scan, cannot execute until Ollama becomes reachable. The same behavior can occur during Discord reconnections because on_ready() is invoked again after a connection is re-established.

The function currently lacks a defined timeout, retry limit, or failure-handling mechanism for prolonged Ollama unavailability.

Steps to Reproduce
  1. Ensure that the SkillBot project dependencies are installed and the bot is configured correctly.
  2. Stop the local Ollama service running on port 11434.
  3. Start the SkillBot application while Ollama remains unavailable.
  4. Allow the bot to execute the wait_for_ollama() function during its startup process.
  5. Observe the application logs for Ollama connection retry messages.
  6. Keep the Ollama service stopped and observe that the function continues retrying every 10 seconds.
  7. Verify that the function does not terminate after a defined number of attempts or a maximum waiting duration.

Expected Result:

The function should stop retrying after a configurable timeout or maximum number of attempts and handle Ollama unavailability gracefully.

Actual Result:

The function continues retrying every 10 seconds indefinitely while Ollama remains unavailable.

Logs and Screenshots

No response

Environment Details

Operating System: Windows 11
Programming Language: Python 3.11.3
Application: SkillBot (Discord Bot)
Discord Library: discord.py 2.7.1
LLM Runtime: Ollama (Local)
Ollama API Endpoint: http://localhost:11434/
Affected File: bot.py
Affected Function: wait_for_ollama()
Affected Workflow: Bot startup and Discord reconnection
Retry Interval: 10 seconds

Impact

High - Major feature is broken

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Ngôn ngữ chính
Python
Star
10
Fork
11
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của AOSSIE-Org/SkillBot

Tất cả issue của AOSSIE-Org/SkillBot

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.