Skip to content

Commit aa30d88

Browse files
committed
address lints and lock more granularly in do_get
1 parent a350566 commit aa30d88

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/flight_service/do_get.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ impl ArrowFlightEndpoint {
9191
let key = doget
9292
.stage_key
9393
.ok_or(Status::invalid_argument("DoGet is missing the stage key"))?;
94-
let once_stage = self.stages.entry(key).or_default();
94+
let once_stage = {
95+
let entry = self.stages.entry(key).or_default();
96+
Arc::clone(&entry)
97+
};
9598

9699
let (state, stage) = once_stage
97100
.get_or_try_init(|| async {

src/flight_service/service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ pub struct StageKey {
3434
pub struct ArrowFlightEndpoint {
3535
pub(super) channel_manager: Arc<ChannelManager>,
3636
pub(super) runtime: Arc<RuntimeEnv>,
37-
pub(super) stages: DashMap<StageKey, OnceCell<(SessionState, Arc<ExecutionStage>)>>,
37+
#[allow(clippy::type_complexity)]
38+
pub(super) stages: DashMap<StageKey, Arc<OnceCell<(SessionState, Arc<ExecutionStage>)>>>,
3839
pub(super) session_builder: Arc<dyn SessionBuilder + Send + Sync>,
3940
}
4041

0 commit comments

Comments
 (0)