korlov42 commented on a change in pull request #581:
URL: https://github.com/apache/ignite-3/pull/581#discussion_r792495889
##########
File path:
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/rel/AbstractExecutionTest.java
##########
@@ -90,6 +116,66 @@ private void handle(Thread t, Throwable ex) {
return fields;
}
+ /** Task reordering executor. */
+ private static class IgniteTestStripedThreadPoolExecutor extends
StripedThreadPoolExecutor {
+ final Deque<Pair<Runnable, Integer>> tasks = new ArrayDeque<>();
+
+ /** Internal stop flag. */
+ AtomicBoolean stop = new AtomicBoolean();
+
+ /** Inner execution service. */
+ ExecutorService exec = Executors.newWorkStealingPool();
+
+ /** {@inheritDoc} */
+ public IgniteTestStripedThreadPoolExecutor(
+ int concurrentLvl,
+ String threadNamePrefix,
+ Thread.UncaughtExceptionHandler exHnd,
+ boolean allowCoreThreadTimeOut,
+ long keepAliveTime
+ ) {
+ super(concurrentLvl, threadNamePrefix, exHnd,
allowCoreThreadTimeOut, keepAliveTime);
+
+ IgniteTestUtils.runAsync(() -> {
+ while (!stop.get()) {
+ synchronized (tasks) {
+ while (!tasks.isEmpty()) {
+ Pair<Runnable, Integer> r = tasks.pollFirst();
+
+ exec.execute(() -> {
+
LockSupport.parkNanos(ThreadLocalRandom.current().nextLong(0, 10_000));
Review comment:
oh, looks like I was wrong, the time unit is nanos, so you park it to
only 10 mills... Nevertheless, with this patch, the `ExecutionTest` runs 10
times longer on my laptop. Let's try to figure it out
--
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]