prestodb/presto · error · PrestoException

CONFIGURATION_INVALID

CONFIGURATION_INVALID

Error message

loadClientRequestFilters can only be called once.

What it means

Lifecycle guard in ClientRequestFilterManager: loadClientRequestFilters had already run (the loaded AtomicBoolean is set), and a second invocation was attempted. Filter factories can only be registered before loading, so this is a duplicate-initialization programming error, not a runtime data problem.

Source

Thrown at presto-main-base/src/main/java/com/facebook/presto/ClientRequestFilterManager.java:58

    private volatile List<ClientRequestFilter> filters = ImmutableList.of();
    private final AtomicBoolean loaded = new AtomicBoolean();

    public void registerClientRequestFilterFactory(ClientRequestFilterFactory factory)
    {
        if (loaded.get()) {
            throw new PrestoException(INVALID_ARGUMENTS, "Cannot register factories after filters are loaded.");
        }

        String name = factory.getName();
        if (factories.putIfAbsent(name, factory) != null) {
            throw new PrestoException(ALREADY_EXISTS, "A factory with the name '" + name + "' is already registered.");
        }
    }

    public void loadClientRequestFilters()
    {
        if (!loaded.compareAndSet(false, true)) {
            throw new PrestoException(CONFIGURATION_INVALID, "loadClientRequestFilters can only be called once.");
        }

        filters = factories.values().stream()
                .map(factory -> factory.create())
                .collect(toImmutableList());
        factories = null;
    }

    public List<ClientRequestFilter> getClientRequestFilters()
    {
        return filters;
    }
}

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Call filter loading once during server startup; report repeated invocation as a bug
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at presto-main-base/src/main/java/com/facebook/presto/ClientRequestFilterManager.java:58 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/9103be4c787e335d. Report an issue: GitHub.