clintropolis commented on code in PR #14184:
URL: https://github.com/apache/druid/pull/14184#discussion_r1181396596
##########
server/src/test/java/org/apache/druid/server/QueryResourceTest.java:
##########
@@ -1043,19 +1045,21 @@ public <T> QueryRunner<T>
getQueryRunnerForIntervals(Query<T> query, Iterable<In
return (queryPlus, responseContext) -> {
beforeScheduler.forEach(CountDownLatch::countDown);
- return scheduler.run(
- scheduler.prioritizeAndLaneQuery(queryPlus, ImmutableSet.of()),
- new LazySequence<T>(() -> {
- inScheduler.forEach(CountDownLatch::countDown);
- try {
- // pretend to be a query that is waiting on results
- Thread.sleep(500);
- }
- catch (InterruptedException ignored) {
- }
- // all that waiting for nothing :(
- return Sequences.empty();
- })
+ return Sequences.simple(
+ scheduler.run(
+ scheduler.prioritizeAndLaneQuery(queryPlus,
ImmutableSet.of()),
+ new LazySequence<T>(() -> {
+ inScheduler.forEach(CountDownLatch::countDown);
+ try {
+ // pretend to be a query that is waiting on results
+ Thread.sleep(500);
+ }
+ catch (InterruptedException ignored) {
+ }
+ // all that waiting for nothing :(
+ return Sequences.empty();
+ })
+ ).toList()
Review Comment:
ah, previously the lock was grabbed eagerly, but this PR changed it to be
lazy with the execution of the sequence, so these tests had to be changed to
actually trigger grabbing the lock
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]