Skip to content

docs(15.9): describe what the Ollama client retries and what it does not - #538

Merged
marevol merged 1 commit into
mainfrom
docs/ollama-retry-read-timeout
Sep 15, 2026
Merged

marevol merged 1 commit into
mainfrom
docs/ollama-retry-read-timeout

Conversation

@marevol

@marevol marevol commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

The Ollama page in the 15.9 tree (config/llm-ollama.rst) describes rag.llm.ollama.retry.max as the "maximum number of HTTP retry attempts (on 429 and 5xx errors)". That is not what the plugin does, and it leaves out the case that matters most for slow local models.

What codelibs/fess-llm-ollama does on main (OllamaLlmClient#executeWithRetry, OllamaEmbeddingClient#executeWithRetry):

  • retry.max is the total number of attempts, the first included (Math.max(1, getRetryMaxAttempts())). The default 3 means two retries, and 1 turns retries off.
  • The retried statuses are 429, 500, 502, 503 and 504 (isRetryableStatus), not every 5xx. Any other error status fails on the first attempt.
  • An IOException is retried too: a refused or reset connection, NoHttpResponseException, a connect timeout. The page did not mention this at all.
  • The wait after the n-th failed attempt is retry.base.delay.ms × 2^(n-1) plus a jitter of up to ±20% of the base delay, capped at 60 seconds (sleepBackoff, MAX_BACKOFF_MS).

codelibs/fess-llm-ollama#29 changes one case: a read (response) timeout is no longer retried. It is rethrown from the first attempt, so a model that never answers holds a request for one timeout instead of three full timeouts plus the backoff. A slow first answer, such as a model that is still loading, needs a larger rag.llm.ollama.timeout (or content_chunker.embedding.ollama.timeout), not more retries.

Changes, all in config/llm-ollama.rst of the 15.9 tree, for ja, en, de, es, fr, ko and zh-cn:

  • The rag.llm.ollama.timeout row calls it the response (read) timeout and says that a request that runs into it is not retried.
  • The rag.llm.ollama.retry.max row says it counts attempts per request to Ollama, the first included.
  • A new "Retries" subsection under "Configuration Options", after "Concurrency Control", covers:
    • what is retried;
    • what is not: a response timeout, any other HTTP error status, and an error Ollama reports inside a streamed response;
    • the backoff;
    • how long a request that keeps failing takes with the defaults: about 6 seconds for a refused connection, about 21 seconds when every connect times out, 60 seconds for a response timeout;
    • that these limits apply per request, and one AI search mode question sends several;
    • that a slow model needs a larger rag.llm.ollama.timeout rather than a larger retry.max;
    • that the embedding client for semantic search follows the same rules, with its own content_chunker.embedding.ollama.* keys in system.properties.

The key names and defaults on the page (timeout 60000, connect.timeout 5000, retry.max 3, retry.base.delay.ms 2000) match the plugin source and are unchanged. No existing heading changes, so no anchor moves.

Requires codelibs/fess-llm-ollama#29 for the read-timeout part; merge it first. The rest of the section describes the plugin as it is on main today.

Verification

  • python3 tools/check_headings.py on all seven 15.9 trees: passes.
  • A docutils parse of the seven edited files, compared with main: each page has one more section (33 instead of 32) and three more bullet lists, all tables keep their shape, and the only new system message is the one for the added :doc: role, which plain docutils does not know. The structure is identical across the seven languages.
  • A Sphinx dummy build of each language's 15.9 tree (built-in extensions only), compared with main: no warning appears only after the change, the page's own warnings are the same 14 in every language, and the :doc: link to search-semantic resolves. A copy with that link pointed at a missing document reports unknown document, so the build does check the link.
  • The retried statuses, the attempt count, the backoff formula and its cap, and the embedding keys and defaults were checked against OllamaLlmClient and OllamaEmbeddingClient on main, and the read-timeout behaviour against the diff of fix: stop retrying a read timeout from Ollama fess-llm-ollama#29.

The non-English wording has not been reviewed by native speakers.

The Ollama page said rag.llm.ollama.retry.max is the number of HTTP
retries on 429 and 5xx errors. In codelibs/fess-llm-ollama it is the
total number of attempts, the retried statuses are 429, 500, 502, 503
and 504, and I/O failures before a response (a refused or reset
connection, a connection closed without a response, a connect timeout)
are retried too. With codelibs/fess-llm-ollama#29 a response timeout is
no longer retried, so a slow model needs a larger timeout, not more
retries.

Correct the timeout and retry.max rows and add a "Retries" subsection
to config/llm-ollama.rst in the 15.9 tree for all seven languages: what
is retried and what is not, the backoff, how long a failing request
takes with the defaults, what to raise for a slow model, and the
matching content_chunker.embedding.ollama.* keys.
@marevol marevol self-assigned this Sep 15, 2026
@marevol
marevol merged commit 97d4297 into main Sep 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant