[BUG#5984]fix multi task delete issue#5983
Conversation
to trigger ci
ruanwenjun
left a comment
There was a problem hiding this comment.
In my perspective, the main change of this pr is adding batch remove logs operation.
This can reduce the rpc calls, it's ok.
But I am not sure using rm -rf paths is better than using jdk's file api directly.
|
hi, thank you very much for your contribution. We only accept discussions in English. We suggest you make changes to the Chinese content. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #5983 +/- ##
============================================
- Coverage 46.75% 46.20% -0.56%
+ Complexity 3743 3711 -32
============================================
Files 604 606 +2
Lines 24820 24888 +68
Branches 2832 2842 +10
============================================
- Hits 11605 11499 -106
- Misses 12074 12262 +188
+ Partials 1141 1127 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
davidzollo
left a comment
There was a problem hiding this comment.
+1
good job, Look forward to making more contributions
kezhenxu94
left a comment
There was a problem hiding this comment.
And there are a lot of code style changes that are not better than don't to change them
| for (String path : taskLogPaths) { | ||
| cmd += os.deleteCmd() + path + ";"; | ||
| } |
There was a problem hiding this comment.
I personally don't think manipulating the command is better than JDK APIs, and you should know manipulating the strings to a system command is dangerous and can be injected malicious codes as well
There was a problem hiding this comment.
其他的部分我倒是能理解。毕竟是追求比较优质的代码。
第一,ds 的使用场景并不是对外的,而是对内的。
第二,如果存在安全漏洞,其实基本可以认为是不太可能的。因为删除的文件名是来自数据库内自动生成的文件,如果会有可注入的风险,就是因为数据的库的信息被串改了。完全属于没病呻吟的情况。
第三,作为DS 4个版本的使用者,我要说一句,现在批量删除的逻辑是有可能导致 这个系统异常的。日志本身在运维阶段属于可以被定期清理的部分。如果UI 操作删除批量日志能导致使用者直接面对系统宕机,系统本身的稳定性是需要紧急优化的。
第四,非得强调jdk 提供的API 才是最安全的这个情况。个人不是没有考虑过服用jdk 的API 。 但是在牺牲一次性删除的方案下,找个看着可能对的方法去做,并不是解决问题的方式。当然可以说开启异步线程去清理。。。但是有必要吗?
There was a problem hiding this comment.
请不要按照开发人员的方式去思考用户该怎么用,因为官方文档里也没有限制用户可嵌套的层级。
后期我个人带着团队用的时候都是直接删除数据库的。
There was a problem hiding this comment.
第一,ds 的使用场景并不是对外的,而是对内的。
Company employees are totally possible to destroy their servers / databases.
第二,如果存在安全漏洞,其实基本可以认为是不太可能的。因为删除的文件名是来自数据库内自动生成的文件,如果会有可注入的风险,就是因为数据的库的信息被串改了。完全属于没病呻吟的情况。
Do you mean if the database is hacked, it's reasonable that your servers should be also hacked? You should limit the exploding radius instead of expanding it.
第三,作为DS 4个版本的使用者,我要说一句,现在批量删除的逻辑是有可能导致 这个系统异常的。日志本身在运维阶段属于可以被定期清理的部分。如果UI 操作删除批量日志能导致使用者直接面对系统宕机,系统本身的稳定性是需要紧急优化的。
You said the original logic is possible to cause exceptions, but didn't explain what exceptions might be caused and why your changes will resolve it.
第四,非得强调jdk 提供的API 才是最安全的这个情况。个人不是没有考虑过服用jdk 的API 。 但是在牺牲一次性删除的方案下,找个看着可能对的方法去做,并不是解决问题的方式。当然可以说开启异步线程去清理。。。但是有必要吗?
请不要按照开发人员的方式去思考用户该怎么用,因为官方文档里也没有限制用户可嵌套的层级。
后期我个人带着团队用的时候都是直接删除数据库的。
Please don't take it personally and don't be so aggressive, reviewers just give their opinions and raise their concerns, giving your reasons is just enough, that's how open source community works, again, don't take it personally, don't be aggressive.
There was a problem hiding this comment.
I'm OK to just give a +1 if you don't like your codes reviewed
|
SonarCloud Quality Gate failed. |
|
I'm sorry this PR was closed, if you have a suitable solution later please feel free to discuss and contribute, of course, it's up to you. First of all:Please use English, as I mentioned above and as you have noticed, all reviewers use English,no matter where they come from, And I see that you have replied to them.It's important to follow the community rules. Secondly:In open source community code contributions, anyone has the right to review, and the code submitted by anyone must be reviewed, whether it is chair or user. it's normal for people to argue, and I don't really want to discuss right or wrong here.but It's important to keep peaceful communication, and the Apache Way emphasizes "respectful, honest, technical-based interaction". |










Purpose of the pull request
Avoid a large number of nested iterative deletions, separate the log file deletion operation from the database cleanup operation, and ensure that the file deletions of the same host are grouped together. l Once host deletes all files on this host.
避免產生大量的嵌套迭代的刪除情況,將日志文件的刪除操作和數據庫清理操作分離,并且保證同一個host 的文件刪除聚合在一起。l連一次host 刪除這個host 上所有文件。
Verify this pull request
This pull request is code cleanup without any test coverage.
compile pass
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows: