Skip to content

Commit

Permalink
Instrument repo_land_stack
Browse files Browse the repository at this point in the history
Summary:
## This stack

Track and down methods that are holding up the reactor and optimize them.

## This diff

`repo_land_stack` often has a max poll time higher than 1s, but it's hard to reproduce locally–by the time we can see a slow event logged, the stack will have landed and running it again will perform very differently. Adding instrumentation will hopefully guide us in the right direction.

Reviewed By: mitrandir77

Differential Revision: D66881892

fbshipit-source-id: 38762138005a59809386629e50727f8de4e39cdc
  • Loading branch information
andreacampi authored and facebook-github-bot committed Dec 9, 2024
1 parent 5ad0c23 commit 51d24ef
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion eden/mononoke/scs/scs_methods/src/methods/repo/land_stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use bookmarks_movement::BookmarkKindRestrictions;
use bookmarks_movement::HookRejection;
use borrowed::borrowed;
use context::CoreContext;
use futures_watchdog::WatchdogExt;
use hooks::PushAuthoredBy;
use mononoke_api::ChangesetSpecifier;
use mononoke_api::MononokeError;
Expand Down Expand Up @@ -141,16 +142,19 @@ impl SourceControlServiceImpl {
PushAuthoredBy::User
};
let repo = self
.repo_for_service(ctx, &repo, params.service_identity)
.repo_for_service(ctx.clone(), &repo, params.service_identity)
.watched(ctx.logger())
.await?;
borrowed!(params.head, params.base);
let head = repo
.changeset(ChangesetSpecifier::from_request(head)?)
.watched(ctx.logger())
.await
.context("failed to resolve head commit")?
.ok_or_else(|| scs_errors::commit_not_found(head.to_string()))?;
let base = repo
.changeset(ChangesetSpecifier::from_request(base)?)
.watched(ctx.logger())
.await
.context("failed to resolve base commit")?
.ok_or_else(|| scs_errors::commit_not_found(base.to_string()))?;
Expand All @@ -175,12 +179,14 @@ impl SourceControlServiceImpl {
push_authored_by,
force_local_pushrebase,
)
.watched(ctx.logger())
.await?
.into_response_with(&(
repo.clone(),
params.identity_schemes,
params.old_identity_schemes,
))
.watched(ctx.logger())
.await?;

Ok(thrift::RepoLandStackResponse {
Expand Down

0 comments on commit 51d24ef

Please sign in to comment.