IGNITE-17086 Warnings added for long lazy SQL queries#11405
IGNITE-17086 Warnings added for long lazy SQL queries#11405oleg-vlsk wants to merge 14 commits intoapache:masterfrom
Conversation
…r and ReduceIndexIterator
…n of suspension/resuming for long-running queries tracking
| req.segmentId(), | ||
| req.pageSize(), | ||
| dataPageScanEnabled); | ||
| GridQueryNextPageResponse msg = h2.executeWithResumableTimeTracking( |
There was a problem hiding this comment.
Tracking is not stopped in case of exception here
There was a problem hiding this comment.
Stopping the time tracking is added to the catch section.
| private final long queryId; | ||
|
|
||
| /** Lock object. */ | ||
| private final Object lock = new Object(); |
There was a problem hiding this comment.
I think explicit lock is redundant, synchronized method can be used.
|
|
||
| H2QueryInfo qry = (H2QueryInfo)qrys.keySet().iterator().next(); | ||
|
|
||
| long extWait = GridTestUtils.getFieldValue(qry, "extWait"); |
There was a problem hiding this comment.
Lets introduce getter for extWait (perhaps for HeavyQueriesTracker.qrys.keySet() too)
There was a problem hiding this comment.
Getters introduced.
|
|
||
| long extWait = GridTestUtils.getFieldValue(qry, "extWait"); | ||
|
|
||
| assertTrue(extWait >= EXT_WAIT_TIME - EXT_WAIT_REL_ERR); |
There was a problem hiding this comment.
Test still can be flaky in some cases, even with EXT_WAIT_REL_ERR. Root cause to this error is async updating of
U.currentTimeMillis(). Instead I propose to modify sleep a little bit, we can replace Thread.sleep(EXT_WAIT_TIME); to something like:
long sleepStartTs = U.currentTimeMillis();
while (U.currentTimeMillis() - sleepStartTs <= EXT_WAIT_REL_ERR)
doSleep(100L);
And in this case we can check extWait without EXT_WAIT_REL_ERR
Thank you for submitting the pull request to the Apache Ignite.
In order to streamline the review of the contribution
we ask you to ensure the following steps have been taken:
The Contribution Checklist
The description explains WHAT and WHY was made instead of HOW.
The following pattern must be used:
IGNITE-XXXX Change summarywhereXXXX- number of JIRA issue.(see the Maintainers list)
the
green visaattached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com #ignite channel.