"Segment has already been emitted" when streaming
- 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.