-
Notifications
You must be signed in to change notification settings - Fork 940
Closed
Labels
Description
SpanExporter#export, LogRecordExporter#export should not be called concurrently, but SimpleSpanProcessor, SimpleLogRecordExporter don't have any synchronization:
Lines 84 to 102 in ee7fd27
| @Override | |
| public void onEnd(ReadableSpan span) { | |
| if (span != null && (exportUnsampledSpans || span.getSpanContext().isSampled())) { | |
| try { | |
| List<SpanData> spans = Collections.singletonList(span.toSpanData()); | |
| CompletableResultCode result = spanExporter.export(spans); | |
| pendingExports.add(result); | |
| result.whenComplete( | |
| () -> { | |
| pendingExports.remove(result); | |
| if (!result.isSuccess()) { | |
| logger.log(Level.FINE, "Exporter failed"); | |
| } | |
| }); | |
| } catch (RuntimeException e) { | |
| logger.log(Level.WARNING, "Exporter threw an Exception", e); | |
| } | |
| } | |
| } |
Lines 63 to 79 in ee7fd27
| @Override | |
| public void onEmit(Context context, ReadWriteLogRecord logRecord) { | |
| try { | |
| List<LogRecordData> logs = Collections.singletonList(logRecord.toLogRecordData()); | |
| CompletableResultCode result = logRecordExporter.export(logs); | |
| pendingExports.add(result); | |
| result.whenComplete( | |
| () -> { | |
| pendingExports.remove(result); | |
| if (!result.isSuccess()) { | |
| logger.log(Level.FINE, "Exporter failed"); | |
| } | |
| }); | |
| } catch (RuntimeException e) { | |
| logger.log(Level.WARNING, "Exporter threw an Exception", e); | |
| } | |
| } |
Noted by @pellared in open-telemetry/opentelemetry-specification#4134 (comment)
Reactions are currently unavailable