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

fix(client): assure error not called on done #3934

Merged
merged 4 commits into from Nov 16, 2021
Merged

fix(client): assure error not called on done #3934

merged 4 commits into from Nov 16, 2021

Conversation

bwanglzu
Copy link
Member

No description provided.

@github-actions github-actions bot added size/S area/core This issue/PR affects the core codebase area/testing This issue/PR affects testing component/client labels Nov 15, 2021
Copy link
Member

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

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

A test needs to be added where no on_error is passed to see that on_done is not called in that case



@pytest.fixture
def flow():
Copy link
Member

Choose a reason for hiding this comment

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

flow_with_exception_request

Copy link
Member

@JoanFM JoanFM left a comment

Choose a reason for hiding this comment

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

Some small required changes

@github-actions
Copy link

github-actions bot commented Nov 15, 2021

Latency summary

Current PR yields:

  • 🐢🐢 index QPS at 1121, delta to last 2 avg.: -9%
  • 🐢🐢 query QPS at 48, delta to last 2 avg.: -13%
  • 🐢🐢 dam extend QPS at 32328, delta to last 2 avg.: -16%
  • 🐢🐢 avg flow time within 1.5843 seconds, delta to last 2 avg.: +12%
  • 😶 import jina within 0.5142 seconds, delta to last 2 avg.: +2%

Breakdown

Version Index QPS Query QPS DAM Extend QPS Avg Flow Time (s) Import Time (s)
current 1121 48 32328 1.5843 0.5142
2.4.5 1233 56 40197 1.4317 0.4869
2.4.4 1230 55 37257 1.379 0.5135

Backed by latency-tracking. Further commits will update this comment.

@codecov
Copy link

codecov bot commented Nov 15, 2021

Codecov Report

Merging #3934 (96734c7) into master (9e846f1) will increase coverage by 0.20%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3934      +/-   ##
==========================================
+ Coverage   88.86%   89.07%   +0.20%     
==========================================
  Files         180      180              
  Lines       12627    12627              
==========================================
+ Hits        11221    11247      +26     
+ Misses       1406     1380      -26     
Flag Coverage Δ
daemon 42.93% <100.00%> (ø)
jina 87.33% <100.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
jina/clients/helper.py 100.00% <100.00%> (ø)
jina/clients/base/helper.py 85.48% <0.00%> (-3.23%) ⬇️
jina/peapods/runtimes/zmq/zed.py 91.78% <0.00%> (ø)
jina/helper.py 83.45% <0.00%> (+0.35%) ⬆️
jina/peapods/peas/__init__.py 86.70% <0.00%> (+2.12%) ⬆️
jina/peapods/pods/__init__.py 88.42% <0.00%> (+3.19%) ⬆️
jina/peapods/pods/compound.py 90.05% <0.00%> (+3.31%) ⬆️

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 9e846f1...96734c7. Read the comment docs.

@@ -79,7 +79,7 @@ def callback_exec(
"""
if on_error and response.status.code >= jina_pb2.StatusProto.ERROR:
_safe_callback(on_error, continue_on_error, logger)(response)
elif on_done:
elif on_done and response.status.code < jina_pb2.StatusProto.ERROR:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
elif on_done and response.status.code < jina_pb2.StatusProto.ERROR:
elif on_done and response.status.code == jina_pb2.StatusProto.SUCCESS:

Copy link
Member Author

Choose a reason for hiding this comment

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

updated!

'', on_done=on_done_mock, on_error=on_error_mock, on_always=on_always_mock
)
on_always_mock.assert_called_once()
on_done_mock.assert_not_called()
Copy link
Member

Choose a reason for hiding this comment

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

do these asserts outside the context, otherwise if exception test may pass

@deepankarm deepankarm merged commit 48a78e7 into master Nov 16, 2021
@deepankarm deepankarm deleted the fix-on-done branch November 16, 2021 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/core This issue/PR affects the core codebase area/testing This issue/PR affects testing component/client size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants