Skip to content
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ changes go in their respective binding's NEXT_CHANGELOG.
### Fixed

- `Session::open` authenticates once before resolving feature flags. A failed OAuth token request now fails the open immediately instead of being sent a second time by CreateSession.
- Telemetry batches rejected with HTTP 429/503 are kept and sent again after a backoff instead of being dropped, at most 1,000 events per request (or one batch, if larger), and telemetry retries log at debug instead of warn. Flushes on session close never wait out the backoff.

---
*Note: When making changes, please add your change under the appropriate
Expand Down
18 changes: 16 additions & 2 deletions src/client/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ use std::sync::{Arc, OnceLock};
use std::time::{Duration, Instant};
use tokio::time::sleep;

/// Log a retry. Telemetry export is fail-open background work, so its
/// retries (e.g. a throttled `/telemetry-ext`) log at debug, not warn.
macro_rules! retry_log {
($request_type:expr, $($arg:tt)*) => {
if $request_type.category() == RequestCategory::Telemetry {
debug!($($arg)*)
} else {
warn!($($arg)*)
}
};
}

/// Build an `Error` for a transport-level non-2xx HTTP response, parsing
/// the SEA error envelope out of the response body when present.
///
Expand Down Expand Up @@ -988,7 +1000,8 @@ impl DatabricksHttpClient {
));
}

warn!(
retry_log!(
request_type,
"{:?}: HTTP {} (attempt {}/{}), waiting {:.1}s before retry",
request_type,
status.as_u16(),
Expand Down Expand Up @@ -1040,7 +1053,8 @@ impl DatabricksHttpClient {
)));
}

warn!(
retry_log!(
request_type,
"{:?}: error (attempt {}/{}): {}, waiting {:.1}s before retry",
request_type,
attempts,
Expand Down
Loading
Loading