message: Prevent deadlock panic when using OpenTelemetryLayer with SpanTrace
diff: @@ -497,8 +497,8 @@ where
  fn on_event(&self, event: &Event<'_>, ctx: Context<'_, S>) {
  // Ignore events that are not in the context of a span
  if let Some(span) = ctx.lookup_current() {
  - let mut extensions = span.extensions_mut();
  - if let Some(builder) = extensions.get_mut::<api::SpanBuilder>() {
  + // Performing read operations before getting a write lock to avoid a deadlock
  + // See https://github.com/tokio-rs/tracing/issues/763
  #[cfg(feature = "tracing-log")]
  let normalized_meta = event.normalized_metadata();
  #[cfg(feature = "tracing-log")]
  @@ -513,13 +513,14 @@ where
  api::Key::new("target").string(meta.target()),
  ],
  );
  + event.record(&mut SpanEventVisitor(&mut otel_event));
  + let mut extensions = span.extensions_mut();
  + if let Some(builder) = extensions.get_mut::<api::SpanBuilder>() {
  if builder.status_code.is_none() && *meta.level() == tracing_core::Level::ERROR {
  builder.status_code = Some(api::StatusCode::Unknown);
  }
  - event.record(&mut SpanEventVisitor(&mut otel_event));
  -
  if let Some(ref mut events) = builder.message_events {
  events.push(otel_event);
  } else {
  