Skip to content

Avoid Result Handle clean up twice which will cause NPE#9728

Merged
JackieTien97 merged 2 commits intomasterfrom
ResultHandleNPE
Apr 28, 2023
Merged

Avoid Result Handle clean up twice which will cause NPE#9728
JackieTien97 merged 2 commits intomasterfrom
ResultHandleNPE

Conversation

@JackieTien97
Copy link
Contributor

@JackieTien97 JackieTien97 commented Apr 27, 2023

  1. Using a bool flag to avoid cleaning ResultHandle up more than once
  2. Forbid the query executor thread interrupted by other threads(e.g. timeout detect thread and so on)
  3. Avoid TaskRunner destruction on cancel
  • Drivers may leave the TaskRunner thread's interrupt flag set during the course of processing, but doing so should not result in the TaskRunner terminating its own processing loop until the TaskExecutor is closed.
  • Instead of allowing the interrupt to terminate the current task runner's loop and re-creating a new runner to replace the interrupted one, we can clear the interrupt flag after each iteration. Otherwise, TaskRunners that were interrupted would have to replace themselves and end up creating unnecessary threads in the cached threadpool executor in the process.

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants