You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "zuzuviewer (via GitHub)" <gi...@apache.org> on 2023/05/24 14:20:48 UTC
[GitHub] [dolphinscheduler] zuzuviewer opened a new pull request, #14199: Fix task instance get dependency and switch parameters exception with…
zuzuviewer opened a new pull request, #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199
… no dependency or switch type task
## Purpose of the pull request
This pull request fix get dependency and switch parameter exception when task is not dependency or switch type
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zuzuviewer commented on a diff in pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "zuzuviewer (via GitHub)" <gi...@apache.org>.
zuzuviewer commented on code in PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#discussion_r1205093846
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java:
##########
@@ -306,12 +306,16 @@ public void init(String host, Date startTime, String executePath) {
}
public DependentParameters getDependency() {
- if (this.dependency == null) {
+ if (this.dependency == null && TASK_TYPE_DEPENDENT.equalsIgnoreCase(this.taskType)) {
Map<String, Object> taskParamsMap =
JSONUtils.parseObject(this.getTaskParams(), new TypeReference<Map<String, Object>>() {
});
+ Object dependence = taskParamsMap.get(Constants.DEPENDENCE);
+ if (dependence == null) {
+ return null;
+ }
Review Comment:
Without this check, JSONUtils.parseObject function will catch exception and return null, return value is also null
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] zuzuviewer commented on a diff in pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "zuzuviewer (via GitHub)" <gi...@apache.org>.
zuzuviewer commented on code in PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#discussion_r1205136768
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java:
##########
@@ -306,12 +306,16 @@ public void init(String host, Date startTime, String executePath) {
}
public DependentParameters getDependency() {
- if (this.dependency == null) {
+ if (this.dependency == null && TASK_TYPE_DEPENDENT.equalsIgnoreCase(this.taskType)) {
Map<String, Object> taskParamsMap =
JSONUtils.parseObject(this.getTaskParams(), new TypeReference<Map<String, Object>>() {
});
+ Object dependence = taskParamsMap.get(Constants.DEPENDENCE);
+ if (dependence == null) {
+ return null;
+ }
Review Comment:
And I think other stage must check it for avoid NPE, because can't guarantee it's not null in the downstream stage even though return not null value in here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS commented on code in PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#discussion_r1205074538
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/entity/TaskInstance.java:
##########
@@ -306,12 +306,16 @@ public void init(String host, Date startTime, String executePath) {
}
public DependentParameters getDependency() {
- if (this.dependency == null) {
+ if (this.dependency == null && TASK_TYPE_DEPENDENT.equalsIgnoreCase(this.taskType)) {
Map<String, Object> taskParamsMap =
JSONUtils.parseObject(this.getTaskParams(), new TypeReference<Map<String, Object>>() {
});
+ Object dependence = taskParamsMap.get(Constants.DEPENDENCE);
+ if (dependence == null) {
+ return null;
+ }
Review Comment:
Returning null in here may cause NPE in the downstream stage. We should find a way to avoid this. cc @ruanwenjun
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#issuecomment-1562180919
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=14199)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=CODE_SMELL) [14 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=CODE_SMELL)
[![8.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '8.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_coverage&view=list) [8.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_coverage&view=list)
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#issuecomment-1562176616
## [Codecov](https://app.codecov.io/gh/apache/dolphinscheduler/pull/14199?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#14199](https://app.codecov.io/gh/apache/dolphinscheduler/pull/14199?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (f6b6927) into [dev](https://app.codecov.io/gh/apache/dolphinscheduler/commit/41e3ce35a70a03e2a44f0858bc91ca2443101043?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (41e3ce3) will **decrease** coverage by `0.07%`.
> The diff coverage is `0.00%`.
> :exclamation: Current head f6b6927 differs from pull request most recent head 896db68. Consider uploading reports for the commit 896db68 to get more accurate results
```diff
@@ Coverage Diff @@
## dev #14199 +/- ##
============================================
- Coverage 38.30% 38.23% -0.07%
+ Complexity 4468 4464 -4
============================================
Files 1229 1229
Lines 42876 42804 -72
Branches 4765 4747 -18
============================================
- Hits 16423 16367 -56
+ Misses 24642 24626 -16
Partials 1811 1811
```
| [Impacted Files](https://app.codecov.io/gh/apache/dolphinscheduler/pull/14199?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [...ache/dolphinscheduler/dao/entity/TaskInstance.java](https://app.codecov.io/gh/apache/dolphinscheduler/pull/14199?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-ZG9scGhpbnNjaGVkdWxlci1kYW8vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvZGFvL2VudGl0eS9UYXNrSW5zdGFuY2UuamF2YQ==) | `25.49% <0.00%> (-21.18%)` | :arrow_down: |
... and [63 files with indirect coverage changes](https://app.codecov.io/gh/apache/dolphinscheduler/pull/14199/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#issuecomment-1562184131
SonarCloud Quality Gate failed. [![Quality Gate failed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/failed-16px.png 'Quality Gate failed')](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=14199)
[![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=BUG)
[![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=VULNERABILITY)
[![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=SECURITY_HOTSPOT)
[![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=CODE_SMELL) [14 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=14199&resolved=false&types=CODE_SMELL)
[![8.6%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/0-16px.png '8.6%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_coverage&view=list) [8.6% Coverage](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_coverage&view=list)
[![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=14199&metric=new_duplicated_lines_density&view=list)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] fuchanghai commented on pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
Posted by "fuchanghai (via GitHub)" <gi...@apache.org>.
fuchanghai commented on PR #14199:
URL: https://github.com/apache/dolphinscheduler/pull/14199#issuecomment-1562183020
#14137
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type [dolphinscheduler]
Posted by "zuzuviewer (via GitHub)" <gi...@apache.org>.
zuzuviewer closed pull request #14199: [Fix-#14137]Fix task instance get dependency and switch parameters exception when task is not dependency or switch type
URL: https://github.com/apache/dolphinscheduler/pull/14199
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org