Skip to content

Commit

Permalink
Note about potential deadlock with virtual threads (#1448)
Browse files Browse the repository at this point in the history
Closes #1440
  • Loading branch information
shakuzen authored Nov 27, 2024
1 parent 67f563c commit 06b47b1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions brave/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,10 @@ Tracing brave4 = Tracing.newBuilder()...build();
Brave brave3 = TracerAdapter.newBrave(brave4.tracer());
```

## Virtual threads

Virtual threads were added in Java 21 via [JEP 444](https://openjdk.org/jeps/444). While the Brave code makes no special consideration for virtual threads, you can generally use Brave with virtual threads. Prior to Java 24, which integrated [JEP 491](https://openjdk.org/jeps/491), it was possible for a deadlock to occur with specific conditions when finishing `Span`s and `ScopedSpan`s on virtual threads - see [#1440](https://github.com/openzipkin/brave/issues/1440).

### Converting between types
Those coding directly to both apis can use `TracerAdapter.toSpan` to
navigate between span types. This is useful when working with client RPC
Expand Down

0 comments on commit 06b47b1

Please sign in to comment.