[Feature-2925][server] Init TaskLogger in TaskExecuteProcessor (#2925)#2965
[Feature-2925][server] Init TaskLogger in TaskExecuteProcessor (#2925)#2965davidzollo merged 2 commits intoapache:devfrom
Conversation
5482a5e to
f36af53
Compare
Codecov Report
@@ Coverage Diff @@
## dev #2965 +/- ##
============================================
+ Coverage 39.11% 39.17% +0.05%
- Complexity 2678 2682 +4
============================================
Files 435 435
Lines 20119 20161 +42
Branches 2454 2459 +5
============================================
+ Hits 7870 7898 +28
- Misses 11514 11525 +11
- Partials 735 738 +3 Continue to review full report at Codecov.
|
|
Hi @gabrywu @dailidong , Can you help to review this PR? Thx a lot. |
|
@yangyichao-mango What's purpose of this PR? Why are there so many irrelevant files to change ? |
Thx a lot for your review @gabrywu . This PR is essentially to get the abnormal exit value caused by the error (exceptions caused by permissions, etc.) when the worker starts to create the working directory, to judge if the user info and work dir is created successfully. But after my change, I found that if the worker failed to create the working directory, the exception it threw would be caught, only recorded in the log of the worker node, not in the log of a single task instance. Although the task will fail at the end of execution, the exception log is very few and it is difficult to locate the exception (permission exception, etc.) directly. In my opinion, I understand that this error should fail fast, or at least recorded by logs. So in order to match the change of my exitval judgment work, I put the initialization change of tasklogger to the beginning of If I have any misunderstanding, please give me suggestions. 非常感谢你的review。 这个pr本质上是为了获取在worker执行task时创建工作目录时的错误(由于权限导致的问题等)值,来判断工作目录,用户权限是否创建成功。 但是在改动完成后,我发现如果worker创作工作目录失败其抛出的异常会被catch住,异常信息只会在worker节点的日志中被记录下来,不会在单个task的日志中记录下来,这相当于创建工作目录相关的所有错误信息完全不会被直接外显给用户。虽然最后task执行的时候会失败,但是异常日志非常少,很难直接定位到工作目录中的异常(权限异常等)。 我理解这种错误应该fail-fast,或者至少有日志来记录,所以为了配合我这次针对exitval判断的改动,我就把taskLogger的初始化改动到了最前面,用来记录涉及到这个task的所有日志。并且我理解taskLogger的原本目的就是用来记录所有涉及到这个task的日志,不仅仅是task运行时的日志。 如果我有理解不正确的地方,敬请指出。 |
You'd better give a suitable title to this issue, otherwise others may have a misunderstanding. If you want to fix different issue, different PRs should be created |
Thx a lot for your review @gabrywu . |
| } catch (Throwable ignored) { | ||
| } |
There was a problem hiding this comment.
why swallow exception?
Thx a lot for your review @dailidong . I've removed the unused exception try catch clause.
|
What is the function of this ThreadLocal? Is it necessary? I think we changed our log format and implemented it with loggerutils |
051feaf to
8725fdc
Compare
Thx a lot for your review @dailidong . |
Thx a lot for your review and work of merging dev branch to current branch @dailidong . |
|
I think no need to rebase if no confilct files |
Thx a lot for your review. @dailidong |
2761c34 to
1ff45c2
Compare
1ff45c2 to
28d8be2
Compare
|
Kudos, SonarCloud Quality Gate passed!
|

What is the purpose of the pull request
Init task logger before init TaskExecuteThread and pass the
taskLoggerin to TaskExecuteThread init method as parameter, so we can record the user and work dir creating log to task instance log, and user can read this log in front-end WebUI. #3014Use common ShellExecutor in FileUtils. #2925
Brief change log
taskLoggerparameter to TaskExecuteThread.Verify this pull request
This pull request is code cleanup without any test coverage.