Skip to content

Commit

Permalink
fix(spanner): end spans for read-write methods (#3629)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshachinta authored Feb 10, 2025
1 parent 40568de commit 4a1f99c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,8 @@ public TransactionManager transactionManager(TransactionOption... options) {
span.setStatus(e);
span.end();
throw e;
} finally {
span.end();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4006,7 +4006,10 @@ public void testTransactionManager_usesOptions() {
when(pool.getSession()).thenReturn(session);
TransactionOption option = mock(TransactionOption.class);

DatabaseClientImpl client = new DatabaseClientImpl(pool, mock(TraceWrapper.class));
TraceWrapper traceWrapper =
new TraceWrapper(Tracing.getTracer(), OpenTelemetry.noop().getTracer(""), false);

DatabaseClientImpl client = new DatabaseClientImpl(pool, traceWrapper);
try (TransactionManager ignore = client.transactionManager(option)) {
verify(session).transactionManager(option);
}
Expand Down

0 comments on commit 4a1f99c

Please sign in to comment.