Skip to content

runtime: add missing _end_locking_query calls in fd_runtime_freeze #5548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/flamenco/runtime/fd_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,19 +282,22 @@ fd_runtime_freeze( fd_exec_slot_ctx_t * slot_ctx, fd_spad_t * runtime_spad ) {
fd_epoch_leaders_t const * leaders = fd_bank_epoch_leaders_locking_query( slot_ctx->bank );
if( FD_UNLIKELY( !leaders ) ) {
FD_LOG_WARNING(( "fd_runtime_freeze: leaders not found" ));
fd_bank_epoch_leaders_end_locking_query( slot_ctx->bank );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the lock really taken if locking_query returns NULL?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

break;
}

fd_pubkey_t const * leader = fd_epoch_leaders_get( leaders, slot_ctx->slot );
if( FD_UNLIKELY( !leader ) ) {
FD_LOG_WARNING(( "fd_runtime_freeze: leader not found" ));
fd_bank_epoch_leaders_end_locking_query( slot_ctx->bank );
break;
}

int err = fd_txn_account_init_from_funk_mutable( rec, leader, slot_ctx->funk, slot_ctx->funk_txn, 1, 0UL );
if( FD_UNLIKELY( err ) ) {
FD_LOG_WARNING(("fd_runtime_freeze: fd_txn_account_init_from_funk_mutable for leader (%s) failed (%d)", FD_BASE58_ENC_32_ALLOCA( leader ), err));
burn = fd_ulong_sat_add( burn, fees );
fd_bank_epoch_leaders_end_locking_query( slot_ctx->bank );
break;
}

Expand Down
Loading