#community-help

Handling Service Unavailable Error in Python Client

TLDR Sidharth asked for suggestions to handle a 503 error in Python. Kishore Nallan and Jason provided guidance, links, and context for handling the error with backoff and retry methods.

Powered by Struct AI
4
8mo
Solved
Join the chat
Feb 08, 2023 (8 months ago)
Sidharth
Photo of md5-051f535431ff484f44f165e9a0b696a5
Sidharth
07:36 AM
Hello Folks,
Need to handle the following error for Python client,
elif http_code == 503:
     return ServiceUnavailable

Any suggestions?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
07:40 AM
Handle meaning? If the server is under heavy write load, and writes are lagging behind indexing queue then it returns 503. You backoff and retry reads and ingest writes more slowly.
Sidharth
Photo of md5-051f535431ff484f44f165e9a0b696a5
Sidharth
07:56 AM
Understood