Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

fix BETWEEN operator; ensure task cancellation when terminating workflow #1734

Merged
merged 1 commit into from Jun 11, 2020

Conversation

apanicker-nflx
Copy link
Collaborator

@apanicker-nflx apanicker-nflx commented Jun 9, 2020

  • Fix BETWEEN operator
    Fix the parsing of the operator

  • Ensure task is cancelled when terminating a workflow
    Remove tasks from the queue first so that polling for tasks will not retrieve these
    Update task status to CANCELED
    Update workflow status to TERMINATED

@codecov
Copy link

codecov bot commented Jun 9, 2020

Codecov Report

Merging #1734 into dev will decrease coverage by 0.10%.
The diff coverage is 68.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##                dev    #1734      +/-   ##
============================================
- Coverage     64.97%   64.87%   -0.11%     
- Complexity     3757     3781      +24     
============================================
  Files           289      289              
  Lines         17856    17932      +76     
  Branches       1614     1620       +6     
============================================
+ Hits          11602    11633      +31     
- Misses         5441     5478      +37     
- Partials        813      821       +8     
Impacted Files Coverage Δ Complexity Δ
...x/conductor/client/telemetry/MetricsContainer.java 72.41% <50.00%> (ø) 18.00 <1.00> (ø)
...om/netflix/conductor/service/ExecutionService.java 38.42% <50.00%> (+0.28%) 29.00 <0.00> (ø)
...lix/conductor/core/execution/WorkflowExecutor.java 79.09% <73.33%> (-0.11%) 169.00 <1.00> (+1.00) ⬇️
...ductor/dao/cassandra/CassandraEventHandlerDAO.java 69.73% <0.00%> (-6.58%) 16.00% <0.00%> (+1.00%) ⬇️
.../com/netflix/conductor/dao/mysql/MySQLBaseDAO.java 67.04% <0.00%> (-4.55%) 17.00% <0.00%> (-2.00%)
...tor/core/config/SystemPropertiesConfiguration.java 61.11% <0.00%> (-3.41%) 30.00% <0.00%> (+5.00%) ⬇️
...com/netflix/conductor/service/WorkflowMonitor.java 66.66% <0.00%> (-2.23%) 5.00% <0.00%> (-1.00%)
...e/execution/tasks/SystemTaskWorkerCoordinator.java 81.25% <0.00%> (-2.09%) 17.00% <0.00%> (-1.00%)
.../conductor/dao/cassandra/CassandraMetadataDAO.java 58.03% <0.00%> (-1.56%) 24.00% <0.00%> (-1.00%)
...nductor/core/orchestration/ExecutionDAOFacade.java 50.99% <0.00%> (-1.17%) 43.00% <0.00%> (+4.00%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4a0c6f...9df9e2b. Read the comment docs.

@coveralls
Copy link

coveralls commented Jun 9, 2020

Pull Request Test Coverage Report for Build 4230

  • 13 of 19 (68.42%) changed or added relevant lines in 3 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 69.44%

Changes Missing Coverage Covered Lines Changed/Added Lines %
client/src/main/java/com/netflix/conductor/client/telemetry/MetricsContainer.java 1 2 50.0%
core/src/main/java/com/netflix/conductor/service/ExecutionService.java 1 2 50.0%
core/src/main/java/com/netflix/conductor/core/execution/WorkflowExecutor.java 11 15 73.33%
Files with Coverage Reduction New Missed Lines %
mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/MySQLBaseDAO.java 3 69.32%
Totals Coverage Status
Change from base Build 4222: -0.02%
Covered Lines: 12402
Relevant Lines: 17860

💛 - Coveralls

@apanicker-nflx apanicker-nflx force-pushed the minor_fixes branch 2 times, most recently from be7b864 to 22a7821 Compare June 10, 2020 01:36
@@ -70,7 +62,7 @@ protected void _parse() throws Exception {
this.value = "IS";
}else if(peeked[0] == '!' && peeked[1] == '='){
this.value = "!=";
}else if(peeked.length == betwnLen && new String(peeked).equals(Operators.BETWEEN.value())) {
}else if(peeked[0] == 'B' && peeked[1] == 'E' && peeked[2] == 'T' && peeked[3] == 'W' && peeked[4] == 'E' && peeked[5] == 'E' && peeked[6] == 'N'){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of things:

  1. Now that we're not checking length of peeked, could it possibly throw ArrayIndexOutOfBounds exception?
  2. Given that STARTS_WITH below still checks with String equals, what was the case for checking each character by element?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh good catch on the ArrayIndexOutOfBounds exception. Pushed out a fix for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parse method always peeks the maxOperatorLength number of characters. After the STARTS_WITH operator was added, the length of this operator is now the max length (11). Now consider the search query excerpt startTime BETWEEN 100 AND 200. In this case, the parse method would now parse the following string BETWEEN 100 which is of length 11. This would fail the String equals comparison and the BETWEEN operator is now non-functional.

@apanicker-nflx apanicker-nflx merged commit 0d4e09a into dev Jun 11, 2020
@apanicker-nflx apanicker-nflx deleted the minor_fixes branch June 11, 2020 00:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants