Skip to content

Commit

Permalink
Add javadoc to Subsegment.close() method.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kurru committed Jul 27, 2022
1 parent 6f29232 commit 6f25e12
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ static Subsegment noOp(Segment parent, AWSXRayRecorder recorder) {
*/
String prettyStreamSerialize();

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

0 comments on commit 6f25e12

Please sign in to comment.