Skip to content

Commit 4ec22f8

Browse files
committed
Add javadoc to Subsegment.close() method.
This method should not be used to end subsegments for segments using multiple threads as this can result in a deadlock. See #318 for details.
1 parent 7e7d732 commit 4ec22f8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/entities

aws-xray-recorder-sdk-core/src/main/java/com/amazonaws/xray/entities/Subsegment.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ static Subsegment noOp(Segment parent, AWSXRayRecorder recorder) {
100100
*/
101101
String prettyStreamSerialize();
102102

103+
/**
104+
* Implements the {@link AutoCloseable} interface.
105+
*
106+
* <p>Warning. Avoid using this to end subsegments in asynchronous methods or other threads as this can cause
107+
* deadlocks. Instead, use {@link com.amazonaws.xray.AWSXRay#endSubsegment(Subsegment)}.
108+
*/
103109
@Override
104110
void close();
105111
}

0 commit comments

Comments
 (0)