-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[fix](Export) Fix the issue where the show export status stays stuck on EXPORTING. #47974
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
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
TPC-H: Total hot run time: 31573 ms |
TPC-DS: Total hot run time: 190806 ms |
ClickBench: Total hot run time: 30.36 s |
|
|
||
| public void cancelMemoryTask(Long taskId) throws JobException { | ||
| try { | ||
| if (taskExecutorMap.containsKey(taskId)) { |
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 suggest to get the task from map first, and then check if it is null and do the cancel.
Because the task may be removed after containsKey() and before get(),
this 2 methods are not atomic
| private void exportExportJob() { | ||
| private void exportExportJob() throws JobException { | ||
| if (getState() == ExportJobState.CANCELLED || getState() == ExportJobState.FINISHED) { | ||
| throw new JobException("export job has been cancelled or finished."); |
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.
Print the job state in error msg.
|
run buildall |
TPC-H: Total hot run time: 31625 ms |
TPC-DS: Total hot run time: 189967 ms |
ClickBench: Total hot run time: 30.03 s |
morningman
left a comment
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.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…on EXPORTING. (#47974) Problem Summary: Each Export task will be deleted after execution in the finally block of the TaskHandler#onTransientTaskHandle() method. Therefore, when removing a task in the TransientTaskManager#cancelMemoryTask method, there should be a check to see if the task exists. Otherwise, a null pointer exception may occur, causing the Export Job status update to fail.
…on EXPORTING. (#47974) Problem Summary: Each Export task will be deleted after execution in the finally block of the TaskHandler#onTransientTaskHandle() method. Therefore, when removing a task in the TransientTaskManager#cancelMemoryTask method, there should be a check to see if the task exists. Otherwise, a null pointer exception may occur, causing the Export Job status update to fail.
…on EXPORTING. (apache#47974) Problem Summary: Each Export task will be deleted after execution in the finally block of the TaskHandler#onTransientTaskHandle() method. Therefore, when removing a task in the TransientTaskManager#cancelMemoryTask method, there should be a check to see if the task exists. Otherwise, a null pointer exception may occur, causing the Export Job status update to fail.
### What problem does this PR solve? Related PR: #47974 Problem Summary: When cancel task, the task should be removed from `taskExecutorMap`, otherwise, if `tryPublishTask()` failed when `addMemoryTask`, the task will be leaked in `taskExecutorMap`
…on EXPORTING. (apache#47974) Problem Summary: Each Export task will be deleted after execution in the finally block of the TaskHandler#onTransientTaskHandle() method. Therefore, when removing a task in the TransientTaskManager#cancelMemoryTask method, there should be a check to see if the task exists. Otherwise, a null pointer exception may occur, causing the Export Job status update to fail.
### What problem does this PR solve? Related PR: apache#47974 Problem Summary: When cancel task, the task should be removed from `taskExecutorMap`, otherwise, if `tryPublishTask()` failed when `addMemoryTask`, the task will be leaked in `taskExecutorMap`
Problem Summary:
Each Export task will be deleted after execution in the finally block of the TaskHandler#onTransientTaskHandle() method. Therefore, when removing a task in the TransientTaskManager#cancelMemoryTask method, there should be a check to see if the task exists. Otherwise, a null pointer exception may occur, causing the Export Job status update to fail.
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)