AdamGS commented on code in PR #15301: URL: https://github.com/apache/datafusion/pull/15301#discussion_r2016437453
########## datafusion/physical-plan/src/topk/mod.rs: ########## @@ -163,26 +187,32 @@ impl TopK { // TODO make this algorithmically better?: // Idea: filter out rows >= self.heap.max() early (before passing to `RowConverter`) // this avoids some work and also might be better vectorizable. - let mut batch_entry = self.heap.register_batch(batch); + let mut heap = self.heap.try_write().map_err(|_| { + DataFusionError::Internal( + "Failed to acquire write lock on TopK heap".to_string(), Review Comment: side issue here - is there a "policy" about using std locks vs parking_lot? a basic search showed they are used roughly equally but it seems like a weird inconsistency (There's also [this](https://github.com/apache/datafusion/pull/1720) ~3 year-old PR by @xudong963). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org