-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IGNITE-17086 Warnings added for long lazy SQL queries #11405
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking is not stopped in case of exception here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stopping the time tracking is added to the catch section.
@@ -65,6 +74,9 @@ public class H2QueryInfo implements TrackableQuery { | |||
/** Query id. */ | |||
private final long queryId; | |||
|
|||
/** Lock object. */ | |||
private final Object lock = new Object(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think explicit lock is redundant, synchronized method can be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected.
|
||
H2QueryInfo qry = (H2QueryInfo)qrys.keySet().iterator().next(); | ||
|
||
long extWait = GridTestUtils.getFieldValue(qry, "extWait"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets introduce getter for extWait
(perhaps for HeavyQueriesTracker.qrys.keySet()
too)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getters introduced.
|
||
long extWait = GridTestUtils.getFieldValue(qry, "extWait"); | ||
|
||
assertTrue(extWait >= EXT_WAIT_TIME - EXT_WAIT_REL_ERR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
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 summary
whereXXXX
- number of JIRA issue.(see the Maintainers list)
the
green visa
attached to the JIRA ticket (see TC.Bot: Check PR)Notes
If you need any help, please email [email protected] or ask anу advice on http://asf.slack.com #ignite channel.