aws / aws/aws-xray-sdk-java

"Segment has already been emitted" when streaming

Aperta
#69 14 commenti 0 reazioni 1 assegnatario Rivendicata da @willarmiros Vedi su GitHub
bug
Lingua principale
Java
Stelle
100
Fork
100
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

SDK version: 2.2.1
Java version: 1.8.0_202

We've run into the known issue of [large traces not sending correctly over UDP](https://github.com/aws/aws-xray-sdk-java/issues/4) so had enabled streaming with the `DefaultStreamingStrategy`, and configured it to stream in chunks of 10. However, we see a large number of errors in the logs like this:

```
com.amazonaws.xray.exceptions.AlreadyEmittedException: Segment foo has already been emitted.
```

It looks like `DefaultStreamingStrategy` is careful to [lock and unlock](https://github.com/aws/aws-xray-sdk-java/blob/master/aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/strategy/DefaultStreamingStrategy.java#L73) access to the list of subsegments in a trace, to avoid synchronization issues. However, this lock is *not* checked (as far as I can see) when the whole trace is finished - meaning it's possible that X-Ray attempts to stream the same segments twice.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.