diff options
author | Eliza Weisman <eliza@buoyant.io> | 2019-03-11 17:08:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-11 17:08:04 -0700 |
commit | 46149f031e406e43fe4ca4d0d3f0ad9e036e2768 (patch) | |
tree | 0deb5ad0551f078767db72ebf0566da797a892c0 /tokio-sync/src | |
parent | 5510ba6dbae3de69d7f69d3a3f1b4bc1e1e179e0 (diff) |
trace-core: Fix `NoSubscriber` causing panics (#975)
PR #973 changed the `tokio_trace_core::span::Id::from_u64` function to
require that the provided `u64` be greater than zero. However, I had
forgotten that the implementation of `Subscriber` for the `NoSubscriber`
type (which is used when no default subscriber is set) always returned
`span::Id::from_u64(0)` from its `new_span` method. In combination with
the assert added in #973, this means that every time a span is hit when
no subscriber is set, `tokio-trace-core` will panic.
This branch fixes the panics by having `NoSubscriber` construct span IDs
using a different (arbitrarily chosen) non-zero constant.
Signed-off-by: Eliza Weisman <eliza@buoyant.io>
Diffstat (limited to 'tokio-sync/src')
0 files changed, 0 insertions, 0 deletions