xai-org/x-algorithm · error · ConfigFailure

Regex maximumPendingRequests must be greater than 0

Error message

Regex maximumPendingRequests must be greater than 0

What it means

ConfigFailure thrown by RegexConfigs.addRegexOptions when maximumPendingRequests <= 0. Since the value is the throttle ceiling used by RegexOptions, zero/negative would make the regex service unusable, so it is rejected at config time.

Source

Thrown at botmaker/src/scala/com/twitter/botmaker/runtime/config/RegexConfigs.scala:29

  override def apply(context: Context[RegexOptionConfigs], config: RegexConfig): RegexConfig = {
    context.getRuntime.addRegexOptions(config)
    config
  }
}

trait RegexOptionConfigs extends ServiceConfigs {

  private final var regexOptions = new RegexConfig()
    .setTimeoutMilis(1000L)
    .setMaximumPendingRequests(20L)

  final def getRegexOptions: RegexConfig = regexOptions

  final def addRegexOptions(config: RegexConfig): Unit = {

    if (config.maximumPendingRequests <= 0) {
      throw ConfigFailure(
        s"Regex maximumPendingRequests must be greater than 0"
      )
    }

    if (config.timeoutMilis <= 0) {
      throw ConfigFailure(
        s"Regex timeoutMilis must be greater than 0"
      )
    }

    if (config.maximumCacheItems <= 0) {
      throw ConfigFailure(
        s"Regex maximumCacheItems must be greater than 0"
      )
    }

    if (config.cacheExpirationMillis <= 0) {
      throw ConfigFailure(

View on GitHub (pinned to 24c60942c5)

Solutions

  1. Set maximumPendingRequests to a positive number sized to expected concurrency
  2. Omit the field if your config loader applies a sane default

Example fix

# before
maximum_pending_requests: 0
# after
maximum_pending_requests: 100
Defensive patterns

Strategy: validation

Validate before calling

require(config.maximumPendingRequests > 0, "maximumPendingRequests must be positive")

Try / catch

catch { case e: ConfigFailure => fail deployment before traffic is served }

Prevention

When it happens

Trigger: Registering regex options with maximum_pending_requests: 0 or negative (often an unset placeholder from templated config).

Common situations: New service scaffolded from a template with 0 placeholders; intending 'unlimited' but the library requires a positive bound.

Related errors


AI-assisted analysis of xai-org/x-algorithm@24c60942c5 (2026-08-28). Data as JSON: /api/errors/545db4e02cc542ba. Report an issue: GitHub.