feat(lambda): honour the Invoke Qualifier and wait between asynchronous retries as AWS does (#4733)

* feat(lambda): honour the Invoke Qualifier query parameter

* feat(lambda): wait between asynchronous retries as AWS does

A failed Event invocation now waits floci.services.lambda.async-retry-delay-seconds before its first retry and twice that before its second (default 60, matching AWS), capped at the event's remaining maximum age. The concurrency permit is held only for each attempt, and an emulator reset drops retries still waiting.

* test(lambda): prove asynchronous retries end to end

* docs(lambda): document asynchronous retry timing and the Invoke Qualifier

* fix(lambda): drop retries of deleted functions and tighten async retry edges

- Drop a pending asynchronous retry when its function (or version) was deleted.
- Decide expiry once, on the injected clock, when a retry is scheduled.
- Check the reset generation at routing, so no stale outcome is delivered.
- Restore upstream behavior when an attempt throws: stop retrying and route
  the previous result, or UnknownError when there is none.
- Harden tests: in-order permit release, deterministic reset, error types
  and an unqualified-ARN Qualifier case for Invoke.

* fix(lambda): drop a deleted function's pending events on every path

Replace the store lookup with a per-function deletion counter, captured
when the event is invoked and checked wherever an event is attempted or
routed. This covers the expiry path, which bypassed the old check, and a
delete-and-recreate of the same name during the wait, which the lookup
could not see. Verified against AWS that DeleteFunction drops pending
retries without delivering a record.

* fix(lambda): clear deletion counts before bumping the reset generation

An invoke between the two statements of clear() captured the new
generation with a stale deletion count and its event was dropped.
The expiry-path deletion test now drops inside the first attempt,
so it no longer races the one-second maximum event age.

* fix(lambda): keep deletion counts across a reset

Clearing them while the old generation was still current let a
deleted function's pending event see a zero count and be routed.
A reset now only bumps the generation, in one atomic step.

* fix(lambda): drop an Event invoke that races DeleteFunction

An Event invoke that resolved the function just before a concurrent
DeleteFunction could take its deletion-count snapshot after the delete
had already moved the count. The event then never looked stale, so the
deleted function could still be started and a failure record could
still reach its destination.

DeleteFunction now moves the deletion count only after the function has
left the store, and an Event invoke checks that the function is still in
the store after it takes its snapshot and before it queues the event.
Either the check sees the function gone and the invoke answers 202
without queueing anything, or the snapshot predates the count change and
the event is dropped as stale later.

* fix(lambda): validate the Invoke Qualifier query parameter

Invoke treated an empty or blank Qualifier as if none had been given
and ran $LATEST, and it passed a qualifier longer than 128 characters on
to the lookup, which answered 404. AWS rejects both with a 400.

A supplied Qualifier must now be 1 to 128 characters of letters,
digits, $, _ and -, or Invoke fails with ValidationException. The
controller reads the parameter from the raw query, because @QueryParam
reports a present but empty value as null and the check could not see
it.

* fix(lambda): stop pending events before a delete or reset removes state

DeleteFunction moved a function's deletion count only after it had
removed the function's code and store entry. A retry whose timer fired
in that gap still passed the staleness check, tried to start a function
with no code, and could deliver a failure record to its destination. An
attempt that finished in that gap could deliver its OnFailure record.
DeleteFunction now moves the count before it deletes anything, which
stops every queued or running event, and again after the store entry is
gone, which stops an Event invoke that read the count in between.

An emulator reset wiped storage before the executor's clear() moved the
reset generation, so a retry firing during the wipe could run or deliver
against half-cleared state. The executor now also moves the generation
in beforeReset(), which runs before the wipe. clear() still moves it, to
drop events accepted between the two.

* test(lambda): fix a doc comment and name the tolerated Docker ping failure

The class comment now reads "wait as they do on AWS". The Docker ping
check names its caught exception "expected" and says why returning
false is safe: the test is then skipped rather than failed.

* fix(lambda): count version and alias invokes against the function's reservation

Routing the Invoke Qualifier to a published version meant a qualified
invoke took its permit against the version's snapshot, which carries no
reservation, so a reserved concurrency of 0 on the function no longer
throttled it and a positive one stopped counting those invokes. The
name-qualified path (fn:1, fn:alias) already had the same gap.

Reserved concurrency is function-wide in AWS, so the executor now takes
the permit against the function's $LATEST record, which holds the
reservation. That covers direct Invoke with a Qualifier, qualified names
and ARNs, aliases, event source mappings and asynchronous retries alike.
It reads the stored record rather than the limiter's region registry
because event source pollers can invoke before LambdaService has
rehydrated that registry after a restart.

* fix(lambda): drop a deleted function's pending events before draining its containers

DeleteFunction drained the warm pool before fencing pending asynchronous
events, and draining blocks while idle containers stop. A retry whose
timer fired in that window still passed the staleness check and could
cold-start a container after the drain, leaving it warm for a function
that no longer exists. The fence now goes up first.
This commit is contained in:
Mario Toffia authored and GitHub committed 2026-10-01 10:00:47 -04:00
1 parent 8a2b998378
commit fa4d4663a2
16 files changed
+1156 -81

No files matched your search

@@ -2733,6 +2733,13 @@ public interface EmulatorConfig {
@WithDefault("1000")
long pollIntervalMs();
/**
* Seconds before the first retry of a failed asynchronous invocation. Retry n waits n times
* this, so the default of 60 matches AWS: one minute, then two. Zero retries back to back.
*/
@WithDefault("60")
int asyncRetryDelaySeconds();
@WithDefault("false")
boolean ephemeral();
@@ -238,8 +238,12 @@ public class LambdaController {
@Path("/functions/{functionName}/invocations")
@Consumes(MediaType.WILDCARD)
public Response invoke(@Context HttpHeaders headers,
@Context UriInfo uriInfo,
@PathParam("functionName") String functionName,
byte[] payload) {
// Read from the query itself: @QueryParam reports a present but empty Qualifier as null, which
// would hide it from the Qualifier validation.
String qualifier = uriInfo.getQueryParameters().getFirst("Qualifier");
String region = regionResolver.resolveRegion(headers);
String invocationTypeHeader = headers.getHeaderString("X-Amz-Invocation-Type");
InvocationType type = InvocationType.parse(invocationTypeHeader);
@@ -258,7 +262,7 @@ public class LambdaController {
.build();
}
InvokeResult result = lambdaService.invoke(region, functionName, payload, type);
InvokeResult result = lambdaService.invoke(region, functionName, qualifier, payload, type);
if (type != InvocationType.Event
&& result.getPayload() != null
@@ -2,6 +2,10 @@ package io.github.hectorvent.floci.services.lambda;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.github.hectorvent.floci.config.EmulatorConfig;
import io.github.hectorvent.floci.core.common.AwsArnUtils;
import io.github.hectorvent.floci.core.common.AwsException;
import io.github.hectorvent.floci.core.common.Resettable;
import io.github.hectorvent.floci.services.lambda.launcher.ContainerHandle;
import io.github.hectorvent.floci.services.lambda.model.FunctionEventInvokeConfig;
import io.github.hectorvent.floci.services.lambda.model.InvokeResult;
@@ -15,28 +19,43 @@ import jakarta.inject.Inject;
import org.jboss.logging.Logger;
import java.time.Clock;
import java.time.Duration;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicLong;
/**
* Orchestrates Lambda function invocations.
* Handles RequestResponse (sync), Event (async fire-and-forget), and DryRun modes.
*
* <p>An Event invocation answers 202 straight away and, once the function has finished on the
* pool, hands its result to {@link AsyncInvokeDestinationRouter}, which delivers it to the
* function's configured destination when it has one.
* <p>An Event invocation answers 202 straight away and hands the final outcome to
* {@link AsyncInvokeDestinationRouter}, which delivers it to the function's configured destination
* when it has one. The first attempt runs on the pool; a failed attempt is retried on a virtual
* thread after the configured delay, as AWS waits one minute and then two.
*/
@ApplicationScoped
public class LambdaExecutorService {
public class LambdaExecutorService implements Resettable {
private static final Logger LOG = Logger.getLogger(LambdaExecutorService.class);
/** Extra time for a newly started runtime to request its first invocation. */
private static final int RUNTIME_DISPATCH_GRACE_SECONDS = 2;
/** How long a retry that found the function's concurrency in use waits before asking again. */
private static final long THROTTLED_RETRY_POLL_MS = 1000;
/**
* Retries run on virtual threads rather than the pool: once the pool's queue is full its
* caller-runs fallback would run a whole attempt on the JDK's shared delay thread, which also
* fires the invocation timeouts that attempt may be waiting on.
*/
private static final Executor RETRY_THREADS = task -> Thread.ofVirtual().name("lambda-async-retry").start(task);
private final WarmPool warmPool;
private final ObjectMapper objectMapper;
@@ -46,6 +65,10 @@ public class LambdaExecutorService {
private final Instance<LambdaService> lambdaServiceInstance;
private final LambdaService directLambdaService;
private final Clock clock;
private final long asyncRetryDelayMs;
/** Moved on by a reset so that retries still waiting from before it are dropped. */
private final AtomicLong generation = new AtomicLong();
private final Map<String, Long> deletions = new ConcurrentHashMap<>();
private final ExecutorService asyncExecutor = new ThreadPoolExecutor(
Math.max(4, Runtime.getRuntime().availableProcessors() * 2),
Math.max(8, Runtime.getRuntime().availableProcessors() * 4),
@@ -59,8 +82,10 @@ public class LambdaExecutorService {
LambdaConcurrencyLimiter concurrencyLimiter,
AsyncInvokeDestinationRouter destinationRouter,
Instance<LambdaService> lambdaServiceInstance,
Clock clock) {
this(warmPool, objectMapper, concurrencyLimiter, destinationRouter, lambdaServiceInstance, null, clock);
Clock clock,
EmulatorConfig config) {
this(warmPool, objectMapper, concurrencyLimiter, destinationRouter, lambdaServiceInstance, null, clock,
Duration.ofSeconds(config.services().lambda().asyncRetryDelaySeconds()));
}
LambdaExecutorService(WarmPool warmPool,
@@ -69,7 +94,7 @@ public class LambdaExecutorService {
AsyncInvokeDestinationRouter destinationRouter,
LambdaService directLambdaService) {
this(warmPool, objectMapper, concurrencyLimiter, destinationRouter, null, directLambdaService,
Clock.systemUTC());
Clock.systemUTC(), Duration.ZERO);
}
LambdaExecutorService(WarmPool warmPool,
@@ -77,8 +102,10 @@ public class LambdaExecutorService {
LambdaConcurrencyLimiter concurrencyLimiter,
AsyncInvokeDestinationRouter destinationRouter,
LambdaService directLambdaService,
Clock clock) {
this(warmPool, objectMapper, concurrencyLimiter, destinationRouter, null, directLambdaService, clock);
Clock clock,
Duration asyncRetryDelay) {
this(warmPool, objectMapper, concurrencyLimiter, destinationRouter, null, directLambdaService, clock,
asyncRetryDelay);
}
private LambdaExecutorService(WarmPool warmPool,
@@ -87,7 +114,8 @@ public class LambdaExecutorService {
AsyncInvokeDestinationRouter destinationRouter,
Instance<LambdaService> lambdaServiceInstance,
LambdaService directLambdaService,
Clock clock) {
Clock clock,
Duration asyncRetryDelay) {
this.warmPool = warmPool;
this.objectMapper = objectMapper;
this.concurrencyLimiter = concurrencyLimiter;
@@ -95,6 +123,7 @@ public class LambdaExecutorService {
this.lambdaServiceInstance = lambdaServiceInstance;
this.directLambdaService = directLambdaService;
this.clock = clock;
this.asyncRetryDelayMs = asyncRetryDelay.toMillis();
}
/** Package-private constructor for testing without CDI, leaving destinations unrouted. */
@@ -102,7 +131,7 @@ public class LambdaExecutorService {
ObjectMapper objectMapper,
LambdaConcurrencyLimiter concurrencyLimiter) {
this(warmPool, objectMapper, concurrencyLimiter, null, (Instance<LambdaService>) null, null,
Clock.systemUTC());
Clock.systemUTC(), Duration.ZERO);
}
LambdaExecutorService(WarmPool warmPool,
@@ -110,7 +139,7 @@ public class LambdaExecutorService {
LambdaConcurrencyLimiter concurrencyLimiter,
AsyncInvokeDestinationRouter destinationRouter) {
this(warmPool, objectMapper, concurrencyLimiter, destinationRouter,
(Instance<LambdaService>) null, null, Clock.systemUTC());
(Instance<LambdaService>) null, null, Clock.systemUTC(), Duration.ZERO);
}
public InvokeResult invoke(LambdaFunction fn, byte[] payload, InvocationType type) {
@@ -146,10 +175,10 @@ public class LambdaExecutorService {
return new InvokeResult(202, null, new byte[0], null, requestId);
}
LambdaConcurrencyLimiter.Permit permit = concurrencyLimiter.acquire(fn);
LambdaService lambdaService = resolveLambdaService();
LambdaConcurrencyLimiter.Permit permit = acquire(lambdaService, fn);
if (type == InvocationType.Event) {
LambdaService lambdaService = resolveLambdaService();
FunctionEventInvokeConfig eventInvokeConfig = null;
if (lambdaService != null) {
try {
@@ -165,46 +194,19 @@ public class LambdaExecutorService {
int maxEventAgeSeconds = eventInvokeConfig != null
&& eventInvokeConfig.getMaximumEventAgeInSeconds() != null
? eventInvokeConfig.getMaximumEventAgeInSeconds() : 21600;
long submitTimeMs = clock.millis();
AsyncEvent event = new AsyncEvent(fn, payload, requestId, chainDepth, invokedQualifier,
maxRetries, clock.millis() + maxEventAgeSeconds * 1000L, generation.get(),
deletions.getOrDefault(functionKey(fn), 0L));
// The deletion count is read above, before this store check, and DeleteFunction moves the count
// again after it removes the function from the store. So either this check sees the function
// gone, or the count moves after the event's snapshot and stale() drops the event.
if (lambdaService != null && !lambdaService.isLive(fn)) {
permit.close();
return new InvokeResult(202, null, new byte[0], null, requestId);
}
try {
asyncExecutor.submit(() -> {
int attempt = 0;
InvokeResult asyncResult = null;
try {
while (attempt <= maxRetries) {
long elapsedSeconds = (clock.millis() - submitTimeMs) / 1000;
if (elapsedSeconds >= maxEventAgeSeconds) {
break;
}
attempt++;
asyncResult = executeSync(fn, payload, requestId);
if (asyncResult.getFunctionError() == null && asyncResult.getStatusCode() < 300) {
break;
}
}
} catch (Exception e) {
LOG.warnv("Error in async Lambda execution for {0}: {1}", fn.getFunctionName(), e.getMessage());
if (asyncResult == null) {
asyncResult = new InvokeResult(500, "Unhandled",
buildErrorPayload("Error executing Lambda: " + e.getMessage(), "Lambda.UnknownError"),
null, requestId);
}
} finally {
permit.close();
}
if (destinationRouter != null) {
if (asyncResult == null) {
// This Floci-only placeholder covers expiry before any attempt; AWS documents no payload.
asyncResult = new InvokeResult(200, "Unhandled",
buildErrorPayload("Event age exceeded", "EventAgeExceeded"),
null, requestId);
}
destinationRouter.route(fn, payload, asyncResult, attempt,
chainDepth, invokedQualifier);
}
});
asyncExecutor.submit(() -> attempt(event, 1, null, permit));
} catch (RuntimeException e) {
permit.close();
throw e;
@@ -229,6 +231,87 @@ public class LambdaExecutorService {
return null;
}
/**
* Reserved concurrency is function-wide, so the permit is taken against the function's {@code $LATEST}
* record, which holds the reservation, rather than a version's snapshot, which has none.
*/
private LambdaConcurrencyLimiter.Permit acquire(LambdaService lambdaService, LambdaFunction fn) {
LambdaFunction function = lambdaService != null ? lambdaService.findLatest(fn).orElse(fn) : fn;
return concurrencyLimiter.acquire(function);
}
/**
* Runs one attempt of an asynchronous event and either routes the outcome or schedules the next
* attempt. Retry n waits n times the configured delay, never past the event's maximum age, and
* the pending event of a function deleted meanwhile is dropped, whether it was waiting to retry
* or to expire. The concurrency permit covers only the attempt; {@code held} is the one the
* invoke itself took.
*/
private void attempt(AsyncEvent event, int attempt, InvokeResult previous,
LambdaConcurrencyLimiter.Permit held) {
if (stale(event) || clock.millis() >= event.expiresAtMs()) {
if (held != null) {
held.close();
}
route(event, previous, attempt - 1);
return;
}
LambdaConcurrencyLimiter.Permit permit;
if (held != null) {
permit = held;
} else {
try {
permit = acquire(resolveLambdaService(), event.fn());
} catch (AwsException throttled) {
// ponytail: AWS backs a throttled retry off exponentially, up to five minutes; one
// fixed poll is enough locally, and the event still expires on time.
schedule(event, THROTTLED_RETRY_POLL_MS, attempt, previous);
return;
}
}
InvokeResult result;
try (permit) {
result = executeSync(event.fn(), event.payload(), event.requestId());
} catch (RuntimeException e) {
LOG.warnv("Error in async Lambda execution for {0}: {1}", event.fn().getFunctionName(), e.getMessage());
// Stops retrying, as upstream did: routes the previous attempt's result, or UnknownError when
// there is none, counting this attempt.
route(event, previous != null ? previous : new InvokeResult(500, "Unhandled",
buildErrorPayload("Error executing Lambda: " + e.getMessage(), "Lambda.UnknownError"),
null, event.requestId()), attempt);
return;
}
if ((result.getFunctionError() == null && result.getStatusCode() < 300) || attempt > event.maxRetries()) {
route(event, result, attempt);
return;
}
schedule(event, asyncRetryDelayMs * attempt, attempt + 1, result);
}
/**
* Decides expiry up front, on the injected clock: the delay thread keeps its own time and may
* wake a hair early.
*/
private void schedule(AsyncEvent event, long delayMs, int attempt, InvokeResult previous) {
long remainingMs = event.expiresAtMs() - clock.millis();
Runnable next = delayMs < remainingMs
? () -> attempt(event, attempt, previous, null)
: () -> route(event, previous, attempt - 1);
CompletableFuture.delayedExecutor(Math.max(0, Math.min(delayMs, remainingMs)), TimeUnit.MILLISECONDS,
RETRY_THREADS).execute(next);
}
private void route(AsyncEvent event, InvokeResult result, int attempts) {
if (destinationRouter == null || stale(event)) {
return;
}
// This Floci-only placeholder covers expiry before any attempt; AWS documents no payload.
InvokeResult outcome = result != null ? result : new InvokeResult(200, "Unhandled",
buildErrorPayload("Event age exceeded", "EventAgeExceeded"), null, event.requestId());
destinationRouter.route(event.fn(), event.payload(), outcome, attempts, event.chainDepth(),
event.invokedQualifier());
}
private InvokeResult executeSync(LambdaFunction fn, byte[] payload, String requestId) {
ContainerHandle handle;
try {
@@ -243,11 +326,11 @@ public class LambdaExecutorService {
long deadlineMs = System.currentTimeMillis() + (long) fn.getTimeout() * 1000;
PendingInvocation invocation = new PendingInvocation(
requestId, payload, deadlineMs, fn.getFunctionArn(),
new java.util.concurrent.CompletableFuture<>());
new CompletableFuture<>());
handle.getRuntimeApiServer().enqueue(invocation);
java.util.concurrent.CompletableFuture.anyOf(
CompletableFuture.anyOf(
invocation.getDispatchedFuture(), invocation.getResultFuture())
.get(fn.getTimeout() + RUNTIME_DISPATCH_GRACE_SECONDS, TimeUnit.SECONDS);
InvokeResult result = invocation.getResultFuture().get();
@@ -275,11 +358,56 @@ public class LambdaExecutorService {
}
}
/**
* Drops the pending asynchronous events of a deleted function: AWS runs no further attempt and
* delivers no record for them. DeleteFunction calls it twice. The call before it drains the warm pool
* and deletes anything stops the events already queued or running, so none starts, or reports a failure
* for, a function whose code is being removed. The call after the function has left the store stops an
* Event invoke that read the count between the two calls and still found the function stored.
*/
void dropPending(LambdaFunction fn) {
// ponytail: deleting a single published version does not drop its pending events; they fail
// to start and are reported as usual, which is rare locally.
deletions.merge(functionKey(fn), 1L, Long::sum);
}
/** Account, region and name, so every version of a function shares one deletion count. */
private static String functionKey(LambdaFunction fn) {
AwsArnUtils.Arn arn = AwsArnUtils.parse(fn.getFunctionArn());
return arn.accountId() + ":" + arn.region() + ":" + fn.getFunctionName();
}
private boolean stale(AsyncEvent event) {
return event.generation() != generation.get()
|| event.deletions() != deletions.getOrDefault(functionKey(event.fn()), 0L);
}
@PreDestroy
public void shutdown() {
generation.incrementAndGet();
asyncExecutor.shutdownNow();
}
/**
* Drops pending events before storage is wiped, so a retry whose timer fires during the wipe neither
* runs nor delivers a record. {@link #clear()} moves the generation again for events accepted in between.
*/
@Override
public void beforeReset() {
generation.incrementAndGet();
}
@Override
public void clear() {
// Only the generation: the deletion counts still fence events from before the reset, so they are
// kept, one per deleted function, as LambdaService keeps its per-function concurrency locks.
generation.incrementAndGet();
}
private record AsyncEvent(LambdaFunction fn, byte[] payload, String requestId, int chainDepth,
String invokedQualifier, int maxRetries, long expiresAtMs, long generation,
long deletions) {}
private byte[] buildErrorPayload(String message, String errorType) {
try {
ObjectNode node = objectMapper.createObjectNode();
@@ -1026,6 +1026,11 @@ public class LambdaService implements ResourceProvider {
LambdaFunction fn = getFunction(region, functionName); // throws 404 if not found
functionName = fn.getFunctionName();
String arn = fn.getFunctionArn();
// Before the drain and anything is deleted, so no queued or running event starts a container for,
// or reports on, a function being removed.
if (executorService != null) {
executorService.dropPending(fn);
}
warmPool.drainFunction(functionName);
// Take the same per-function lock used by Put/DeleteFunctionConcurrency
// so a concurrent concurrency mutation cannot interleave with the
@@ -1040,6 +1045,10 @@ public class LambdaService implements ResourceProvider {
}
codeStore.delete(ownerAccount(fn), region, functionName);
functionStore.delete(region, functionName);
// Again now the function is gone, for an Event invoke that read the count after the first call.
if (executorService != null) {
executorService.dropPending(fn);
}
reclaimLegacyCodeDirectoryIfUnused(functionName);
versionCounters.remove(versionCounterKey(region, fn));
versionCounters.remove(legacyVersionCounterKey(region, functionName));
@@ -1061,6 +1070,20 @@ public class LambdaService implements ResourceProvider {
LOG.infov("Deleted Lambda function: {0}", functionName);
}
/**
* The {@code $LATEST} record of the function {@code fn} belongs to, whichever version {@code fn} is.
* Looked up in the account and region of its ARN rather than the caller's.
*/
Optional<LambdaFunction> findLatest(LambdaFunction fn) {
AwsArnUtils.Arn arn = AwsArnUtils.parse(fn.getFunctionArn());
return functionStore.getForAccount(arn.accountId(), arn.region(), fn.getFunctionName());
}
/** Whether the function {@code fn} belongs to is still in the store, whichever version {@code fn} is. */
boolean isLive(LambdaFunction fn) {
return findLatest(fn).isPresent();
}
/**
* Drops the code directory a deleted version owned. Without this the only thing that ever
* reclaimed version code was deleting the whole function, so a repeated publish/delete cycle
@@ -1105,8 +1128,16 @@ public class LambdaService implements ResourceProvider {
}
public InvokeResult invoke(String region, String functionName, byte[] payload, InvocationType type) {
LambdaArnUtils.ResolvedFunctionRef ref = LambdaArnUtils.resolve(functionName);
enforceRegion(region, ref);
return invoke(region, functionName, null, payload, type);
}
/**
* Invokes a function, reconciling a qualifier carried on the name with Invoke's {@code Qualifier} query parameter.
*/
public InvokeResult invoke(String region, String functionName, String queryQualifier, byte[] payload,
InvocationType type) {
validateInvokeQualifier(queryQualifier);
LambdaArnUtils.ResolvedFunctionRef ref = resolveWithRegion(region, functionName, queryQualifier);
String name = ref.name();
String qualifier = ref.qualifier();
LambdaFunction fn;
@@ -2691,6 +2722,13 @@ public class LambdaService implements ResourceProvider {
validatePattern(aliasName, "name", ALIAS_NAME_PATTERN);
}
/** Invoke's Qualifier, when supplied: 1-128 characters matching {@link #QUALIFIER}. */
private static void validateInvokeQualifier(String qualifier) {
validateNonEmpty(qualifier, "qualifier", false);
validateMaxLength(qualifier, "qualifier", 128);
validatePattern(qualifier, "qualifier", QUALIFIER);
}
public void deleteAlias(String region, String functionName, String aliasName) {
validatePattern(aliasName, "name", ALIAS_NAME_PATTERN);
String canonical = canonicalFunctionName(region, functionName);