Skip to content

Commit 32014c2

Browse files
committed
Stop modifying parent operation span after it is stopped
When a getMore command arrived, the cursor_id was being set on the parent operation span's MongodbContext even though the parent observation was already stopped. Modifying an observation after stop() is undefined behavior in Micrometer
1 parent db5387c commit 32014c2

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

driver-core/src/main/com/mongodb/internal/observability/micrometer/TracingManager.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -223,11 +223,6 @@ public Span createTracingSpan(final CommandMessage message,
223223
if (command.containsKey("getMore")) {
224224
long cursorId = command.getInt64("getMore").longValue();
225225
mongodbContext.setCursorId(cursorId);
226-
// Also set on parent operation span context for correlation
227-
MongodbContext parentContext = operationSpan != null ? operationSpan.getMongodbContext() : null;
228-
if (parentContext != null) {
229-
parentContext.setCursorId(cursorId);
230-
}
231226
}
232227

233228
SessionContext sessionContext = operationContext.getSessionContext();

0 commit comments

Comments
 (0)