@@ -140,14 +140,15 @@ public Timestamp writeAtLeastOnce(Iterable<Mutation> mutations) throws SpannerEx
|
140 | 140 | try (Scope s = tracer.withSpan(span)) {
|
141 | 141 | CommitResponse response = spanner.getRpc().commit(request, options);
|
142 | 142 | Timestamp t = Timestamp.fromProto(response.getCommitTimestamp());
|
143 |
| -span.end(TraceUtil.END_SPAN_OPTIONS); |
144 | 143 | return t;
|
145 | 144 | } catch (IllegalArgumentException e) {
|
146 |
| -TraceUtil.endSpanWithFailure(span, e); |
| 145 | +TraceUtil.setWithFailure(span, e); |
147 | 146 | throw newSpannerException(ErrorCode.INTERNAL, "Could not parse commit timestamp", e);
|
148 | 147 | } catch (RuntimeException e) {
|
149 |
| -TraceUtil.endSpanWithFailure(span, e); |
| 148 | +TraceUtil.setWithFailure(span, e); |
150 | 149 | throw e;
|
| 150 | +} finally { |
| 151 | +span.end(TraceUtil.END_SPAN_OPTIONS); |
151 | 152 | }
|
152 | 153 | }
|
153 | 154 |
|
@@ -208,10 +209,11 @@ public void close() {
|
208 | 209 | Span span = tracer.spanBuilder(SpannerImpl.DELETE_SESSION).startSpan();
|
209 | 210 | try (Scope s = tracer.withSpan(span)) {
|
210 | 211 | spanner.getRpc().deleteSession(name, options);
|
211 |
| -span.end(TraceUtil.END_SPAN_OPTIONS); |
212 | 212 | } catch (RuntimeException e) {
|
213 |
| -TraceUtil.endSpanWithFailure(span, e); |
| 213 | +TraceUtil.setWithFailure(span, e); |
214 | 214 | throw e;
|
| 215 | +} finally { |
| 216 | +span.end(TraceUtil.END_SPAN_OPTIONS); |
215 | 217 | }
|
216 | 218 | }
|
217 | 219 |
|
|
0 commit comments