Skip to content

Commit

Permalink
add backtrace on wait version timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
wenym1 committed Jan 21, 2025
1 parent e4d75aa commit 7ebc0d1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/storage/src/hummock/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::backtrace::Backtrace;
use std::cmp::Ordering;
use std::collections::VecDeque;
use std::fmt::{Debug, Formatter};
Expand Down Expand Up @@ -637,6 +638,11 @@ pub(crate) async fn wait_for_update(
loop {
match tokio::time::timeout(Duration::from_secs(30), receiver.changed()).await {
Err(_) => {
let backtrace = if cfg!(debug_assertions) {
format!("{:?}", Backtrace::capture())
} else {
"backtrace log not enabled in non-debug mode".into()
};
// The reason that we need to retry here is batch scan in
// chain/rearrange_chain is waiting for an
// uncommitted epoch carried by the CreateMV barrier, which
Expand All @@ -649,6 +655,7 @@ pub(crate) async fn wait_for_update(
tracing::warn!(
info = periodic_debug_info(),
elapsed = ?start_time.elapsed(),
backtrace,
"timeout when waiting for version update",
);
continue;
Expand Down

0 comments on commit 7ebc0d1

Please sign in to comment.