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

libp2p: fix for slow dht lookups using extra queue #2642

Merged
merged 18 commits into from
Dec 14, 2021

Conversation

solarw
Copy link
Contributor

@solarw solarw commented Oct 2, 2021

Proposed changes

libp2p: fix for slow dht lookups using extra queue
slow dht lookup envelopes are moved to slow queue to avoid blocking of "good" envelopes

Fixes

#2634

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Lint and unit tests pass locally with my changes and CI passes too
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that code coverage does not decrease.
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Further comments

If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...

DELETE INCLUSIVE THIS AND BELOW FOR STANDARD PR

Release summary

Version number: [e.g. 1.0.1]

Release details

Describe in short the main changes with the new release.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING doc
  • I am making a pull request against the main branch (left side), from develop
  • Lint and unit tests pass locally and in CI
  • I have checked the fingerprint hashes are correct by running (scripts/generate_ipfs_hashes.py)
  • I have regenerated the latest API docs
  • I built the documentation and updated it with the latest changes
  • I have added an item in HISTORY.md for this release
  • I bumped the version number in the aea/__version__.py file.
  • I bumped the version number in every Docker image of the repo and published it. Also, I built and published them with tag latest
    (check the READMEs of aea-develop
    and aea-user)
  • I have pushed the latest packages to the registry.
  • I have uploaded the latest aea to PyPI.
  • I have uploaded the latest plugins to PyPI.

Further comments

Write here any other comment about the release, if any.

@solarw solarw force-pushed the fix/libp2p_slow_dht_lookups branch 3 times, most recently from c62d5da to a1f9dc8 Compare October 6, 2021 09:21
@solarw solarw force-pushed the fix/libp2p_slow_dht_lookups branch 2 times, most recently from 493af30 to c96dda0 Compare October 6, 2021 15:09
@codecov-commenter
Copy link

codecov-commenter commented Oct 6, 2021

Codecov Report

Merging #2642 (5d6fe9a) into develop (d3881e1) will increase coverage by 0.08%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop     #2642      +/-   ##
============================================
+ Coverage    99.91%   100.00%   +0.08%     
============================================
  Files          521       516       -5     
  Lines        35888     35874      -14     
============================================
+ Hits         35858     35874      +16     
+ Misses          30         0      -30     
Flag Coverage Δ
unittests 100.00% <ø> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
packages/fetchai/contracts/erc1155/contract.py 100.00% <0.00%> (ø)
...kages/fetchai/skills/task_test_skill/behaviours.py
...ckages/fetchai/skills/error_test_skill/__init__.py
...ackages/fetchai/skills/task_test_skill/__init__.py
...ages/fetchai/skills/error_test_skill/behaviours.py
packages/fetchai/skills/task_test_skill/tasks.py
aea/cli/registry/utils.py 100.00% <0.00%> (+0.75%) ⬆️
aea/test_tools/test_contract.py 100.00% <0.00%> (+2.32%) ⬆️

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 d3881e1...5d6fe9a. Read the comment docs.

@solarw solarw force-pushed the fix/libp2p_slow_dht_lookups branch 4 times, most recently from 27d6b9f to 0664c3d Compare October 8, 2021 08:27
@solarw solarw force-pushed the fix/libp2p_slow_dht_lookups branch from 0664c3d to 5d6fe9a Compare October 8, 2021 08:38
Copy link
Member

@5A11 5A11 left a comment

Choose a reason for hiding this comment

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

lgtm

with open(self.conn.node.log_file) as f:
return "while sending slow envelope:" in f.read()

wait_for_condition(_check, timeout=30, period=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

As I understand it, this will throw a timeout exception if the slow queue is not used, but since this is inside a try-except, won't the test always pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's try..finally to disconnect the connection in case of fail, no exceptions handled or supressed

@jrriehl jrriehl self-requested a review December 14, 2021 08:39
@5A11 5A11 merged commit bc78738 into develop Dec 14, 2021
@5A11 5A11 deleted the fix/libp2p_slow_dht_lookups branch July 13, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants