Skip to content
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

perf: 优化对 GSE任务查询结果为空的处理 #2132

Closed
wangyu096 opened this issue Jun 14, 2023 · 0 comments
Closed

perf: 优化对 GSE任务查询结果为空的处理 #2132

wangyu096 opened this issue Jun 14, 2023 · 0 comments
Assignees
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/enhancement 功能改进特性

Comments

@wangyu096
Copy link
Collaborator

问题

GSE 可能会出现任务延迟的情况,导致返回的结果为

[2023-06-13 19:24:50.776]  INFO [job-execute,9ecc92710f2cd5111024c310aabbc2f0,49ea0f2b7fa2d091] 32257 --- [task-result-handle-12533] c.t.bk.job.common.gse.v1.GseV1ApiClient  : GetScriptTaskDetailResponse: api_task_detail_result(bk_error_code:1000115,bk_error_msg:redis reply is not string,result:null)

Job 处理响应结果的时候,由于 result 为空,出现了空指针错误

[2023-06-13 19:24:50.776] ERROR [job-execute,9ecc92710f2cd5111024c310aabbc2f0,49ea0f2b7fa2d091] 32257 --- [task-result-handle-12533] c.t.b.j.e.e.r.AbstractResultHandleTask   : [GseTask:33612141499:29253313661:0]: analyse gse task result error.

java.lang.NullPointerException: null

[2023-06-13 19:24:50.776] ERROR [job-execute,9ecc92710f2cd5111024c310aabbc2f0,49ea0f2b7fa2d091] 32257 --- [task-result-handle-12533] c.t.b.j.e.e.r.AbstractResultHandleTask   : [GseTask:33612141499:29253313661:0]: result handle error.

java.lang.NullPointerException: null

优化方案

  1. 对于 GSE 返回的 result 为空的场景,进行容错处理。只有到 result 持续为空一段时间之后,才会判定为任务失效,才会终止调度,并设置任务为状态异常
@wangyu096 wangyu096 added kind/enhancement 功能改进特性 backlog 需求初始状态,等待产品进行评估 todo 进入开发排期的状态,纳入了最近的迭代 labels Jun 14, 2023
@wangyu096 wangyu096 self-assigned this Jun 14, 2023
jsonwan added a commit that referenced this issue Jun 14, 2023
perf: 优化对 GSE任务查询结果为空的处理 #2132
wangyu096 added a commit that referenced this issue Jun 14, 2023
perf: 优化对 GSE任务查询结果为空的处理 #2132
@bkjob-bot bkjob-bot added for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 done 已上线到正式环境并验收通过 and removed backlog 需求初始状态,等待产品进行评估 todo 进入开发排期的状态,纳入了最近的迭代 for test 可以在测试环境进行验收 for gray 可以在灰度环境/预发布环境验收 labels Jun 15, 2023
@bkjob-bot bkjob-bot added the for test 可以在测试环境进行验收 label Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done 已上线到正式环境并验收通过 for test 可以在测试环境进行验收 kind/enhancement 功能改进特性
Projects
None yet
Development

No branches or pull requests

2 participants