Knowledgebase:
Group-level “Retry timeout” vs AppServer-level “Default time limit”
28 June 2023 01:59 PM

Introduction

Understanding what are the timeout/time-limit configuration options offered by MarkLogic is important when working with queries. There are a set of options that can be configured at group-level and another set of options that can be configured at app-server-level. One can find an extensive list of what those options are and what each option is used for in the documentation (links at the end), but in this article, we will be discussing two of the important timeout configuration options and how they work with each other - Retry timeout and Default time limit.

Quick Overview

The retry-timeout is the time, in seconds, before a MarkLogic Server stops retrying a request whereas the default-time-limit is the default value for any request’s time limit, when otherwise specified.

A deeper dive

To elaborate on that, the "retry timeout" (group-level setting) is the total time the server will spend waiting to retry (not executing the request itself), so if a request fails in one millisecond with a retryable error (and in general a retry happens every 2 secs), we end up retrying roughly 90 times if the retry-timeout value is set to the default value 180 (90*2 secs = 180). The "default-time-limit" (appserver-level setting), on the other hand, is for each retry i.e, for each retry, the request time gets reset to 0 secs with the default-time-limit which means it is supposed to timeout at the end of whatever value the default-time-limit is configured with. However, if the request fails with a retryable error, a retry happens after a wait time of around 2 secs which means the request time gets reset again to 0 secs and will be set to timeout at the end of the default-time-limit.

The above behavior is better explained in a sequence of events listed below:

-> start request time

     -> request time is set to 0 (with a limit of "default time limit" value)

-> request fails with retryable error

-> wait some time t1 before retrying (which is usually 2sec, in general)

-> retry

     -> request time is reset to 0

-> request fails with retryable error

-> wait some time t2 before retrying

-> retry

     -> request time is reset to 0

-> request fails with retryable error

-> wait some time t3 before retrying

-> retry

     -> request time is reset to 0

-> request succeeds

-> end request time

where "retry-timeout" value is the limit for all retry times combined (t1 + t2 +t3) and "default-time-limit" value is the limit for each retry.

For instance, if the retry-timeout is 180 secs and the default-time-limit is 120 secs, the request will still retry until the 180sec retry timeout is met because the 120 sec limit is for each retry and wouldn’t affect the retry timeout. However, a single retry (or the original request) will timeout at 120 secs.

Further reading

(1 vote(s))
Helpful
Not helpful

Comments (0)