-
Notifications
You must be signed in to change notification settings - Fork 504
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
fix: gremlin exec timeout cause statement unclose #1643
Conversation
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放 fix apache#1639
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放 fix apache#1639
Codecov Report
@@ Coverage Diff @@
## master #1643 +/- ##
============================================
- Coverage 66.99% 66.96% -0.03%
+ Complexity 7069 7067 -2
============================================
Files 421 421
Lines 34646 34655 +9
Branches 4798 4798
============================================
- Hits 23210 23208 -2
- Misses 9094 9102 +8
- Partials 2342 2345 +3
Continue to review full report at Codecov.
|
return this.query.reachLimit(count); | ||
try { | ||
checkInterrupted(); | ||
return this.query.reachLimit(count); |
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.
it's ok to just catch checkInterrupted()
, we assume other exception will be handled by upper layer.
try { | ||
checkInterrupted(); | ||
return this.query.reachLimit(count); | ||
} catch (BackendException e) { |
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.
catch Throwable
LOG.warn("Failed to close backend entry iterator for interrupted query", ex); | ||
} | ||
throw e; | ||
} |
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.
also catch QueryResults.toList(Iterator<T> iterator)
which may cause leak if exception occurred, and close in finally block:
try {
return new ListIterator<>(Query.DEFAULT_CAPACITY, iterator);
} finally {
CloseableIterator.closeIterator(iterator);
}
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放 fix apache#1639
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放 fix apache#1639
} catch (Throwable e) { | ||
try { | ||
this.close(); | ||
} catch (Exception ex) { |
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.
catch(Throwable ex)
checkInterrupted(); | ||
try { | ||
checkInterrupted(); | ||
} catch (Throwable e) { |
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.
don't need a space between "catch ("
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放 fix apache#1639
Fix bug: gremlin语句执行超时 将导致内存泄漏statement未释放
fix #1639