[Bug]: Shared OTel plugin state mixes concurrent LMI invocations
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Stack tecnológico
- java
- Área
- observability
Línea de trabajo
Start with ExecutionOtelPlugin.java and InvocationOtelPlugin.java, then read PluginRunner.java to understand the real SDK registration and dispatch path. The issue asks for overlapping-invocation tests covering both OTel views, lifecycle cases and reused operation IDs, plus deployed LMI coverage proving same-JVM overlap; verify those outcomes and any registration migration documentation. PR #721 is already open proposing per-invocation plugin instances.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Expected Behavior
Concurrent Lambda Managed Instances invocations must keep their OTel execution state isolated. Each operation must be attributed to its owning execution, and ending/resetting one invocation must not invalidate another invocation’s telemetry.
Actual Behavior
A single published ExecutionOtelPlugin instance stores the current execution ARN and span state in mutable fields. Interleaving onInvocationStart(A), onInvocationStart(B) and onOperationEnd(A-step) exports A-step with B’s durable.execution.arn. The same sequence using separate plugin instances correctly exports A’s ARN. Java LMI shares the handler/JVM between request threads, so environment-lifetime plugin objects can be used by overlapping invocations.
This was reproduced locally with the published plugin and an in-memory exporter. The interleaving is deterministic; it is not a fresh cloud concurrency measurement.
Steps to Reproduce
Use a scratch Maven project with software.amazon.lambda.durable:aws-durable-execution-sdk-java-plugin-otel:2.2.1 and io.opentelemetry:opentelemetry-sdk-testing:1.65.0, including their transitive dependencies. Compile and run OtelLmiStateProbe below on Java 25. No Lambda credentials or service calls are involved.
The shared-object case reports A’s operation under .../B; the separate-instance control reports .../A. Assertions describe the pre-fix behavior.
Reproduction code
import java.time.Instant;
import java.util.*;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.opentelemetry.api.common.AttributeKey;
import io.opentelemetry.sdk.trace.SdkTracerProvider;
import io.opentelemetry.sdk.trace.samplers.Sampler;
import io.opentelemetry.sdk.trace.export.SimpleSpanProcessor;
import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter;
import software.amazon.lambda.durable.otel.*;
import software.amazon.lambda.durable.plugin.*;
public class OtelLmiStateProbe {
static final Instant START=Instant.parse("2026-10-02T00:00:00Z");
static final String BASE="arn:aws:lambda:us-west-2:123456789012:function:probe:1/durable-execution/probe/";
static ExecutionOtelPlugin plugin(InMemorySpanExporter exporter) {
return new ExecutionOtelPlugin(
SdkTracerProvider.builder().setSampler(Sampler.alwaysOn()).addSpanProcessor(SimpleSpanProcessor.create(exporter)),
OtelPluginConfig.builder().enableMdc(false).contextExtractor(() -> null).build());
}
public static void main(String[] args) throws Exception {
var results=new ArrayList<Map<String,Object>>();
for (boolean shared:new boolean[]{true,false}) {
var exporter=InMemorySpanExporter.create();
var a=plugin(exporter);
var b=shared?a:plugin(exporter);
a.onInvocationStart(new InvocationInfo("request-A",BASE+"A",true,START));
b.onInvocationStart(new InvocationInfo("request-B",BASE+"B",true,START));
a.onOperationEnd(new OperationEndInfo("A-step","A-step","STEP","Step",null,START,START.plusSeconds(1),"SUCCEEDED",null,false,null));
var spans=exporter.getFinishedSpanItems().stream().filter(s -> s.getName().equals("A-step")).toList();
if(spans.size()!=1)throw new AssertionError("Expected one A-step span");
var assignedArn=spans.getFirst().getAttributes().get(AttributeKey.stringKey("durable.execution.arn"));
if(!(BASE+(shared?"B":"A")).equals(assignedArn))throw new AssertionError("Unexpected assignment: "+assignedArn);
results.add(Map.of("sharedPluginInstance",shared,"operation","A-step","expectedExecution",BASE+"A","actualExecution",assignedArn));
}
System.out.println(new ObjectMapper().writeValueAsString(Map.of("sdkAndPluginVersion","2.2.1","results",results,"checksPassed",true)));
}
}
SDK Version
Core SDK / OTel plugin 2.2.1. Main rechecked at 78574e3051aac9b5ca00a0c1fd2b91eab72a9e15.
Java Version
Corretto 25.0.4.1
Is this a regression?
Unknown; no last-known-good version has been established.
Additional Context
The Java LMI runtime uses request threads sharing one handler and static state. Relevant code: ExecutionOtelPlugin, InvocationOtelPlugin, and plugin dispatch.
PR #721 proposes per-invocation plugin instances. This issue tracks the OTel defect and its release/validation outcome. The core executor/deadline issues in #726 and the cloud-test request in #727 remain separate work.
Acceptance criteria
- Verify both OTel views with overlapping invocations and reused operation IDs through the real SDK registration/dispatch path.
- Ensure invocation completion, suspension, retries, errors and late hooks cannot alter another invocation’s spans or context.
- Preserve shared provider/exporter ownership and add deployed LMI coverage with proven same-JVM overlap.
- Document the factory migration and compatible SDK/plugin versions if the fix changes registration.
Related cross-SDK tracking: https://github.com/aws/aws-durable-execution-sdk-js/issues/950
- Lenguaje dominante
- Java
- Estrellas
- 28
- Forks
- 13
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 40
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-durable-execution-sdk-java
-
bug pkg:sdk
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
aws/aws-durable-execution-sdk-java#773 ·
Los mantenedores suelen responder en 1 día
-
documentation pkg:sdk
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
aws/aws-durable-execution-sdk-java#645 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
aws/aws-durable-execution-sdk-java#300 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: root handler instrumentation misses the canonical OTel execution contextPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoneeds-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 40/100
aws/aws-durable-execution-sdk-java#770 ·
Los mantenedores suelen responder en 1 día
-
[Feature]: Propagate per-operation trace context for chained invokesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoenhancement needs-triage
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
aws/aws-durable-execution-sdk-java#764 ·
Los mantenedores suelen responder en 1 día
Todos los issues de aws/aws-durable-execution-sdk-java
Issues similares
-
[destination-snowflake] Custom domains rejected unlike source connectionsPosiblemente ocupada @kuza55 la tomó hoy. Abiertoautoteam community connectors/destination/snowflake team/use
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
area-dashboard
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
component/operate kind/feature-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Forge coverage prompts carry text the agent cannot act onPosiblemente ocupada @graalvmbot la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
oracle/graalvm-reachability-metadata#10572 ·
Los mantenedores suelen responder en 1 día
-
[CI] Core CI doesn't run for changes to amoro-format-lance (and amoro-web)Posiblemente ocupada @MarkAlex1234 la tomó hoy. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días