-
Notifications
You must be signed in to change notification settings - Fork 106
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
[ASI-880] Async fetching cid metadata #2575
Conversation
* Revert "[AUD-1374] [AUD-1372] Add new favorites endpoints and include referenced metadata (#2385)" (#2484) This reverts commit 8b9b0bd. * Harden openresty code (#2496) * Fix notification prev entries * Fix test * Fix lint * Update single entry query and lint fix Co-authored-by: Marcus Pasell <rickyrombo@users.noreply.github.com> Co-authored-by: Cheran <cheran.v.senthil@gmail.com> Co-authored-by: KJ Shanks <kyle.j.shanks@gmail.com>
* Recalculate challenges * Use real table
* Bump discovery version * Bump content version
* Fix is current * Fix user history * Fix revert case * Fix or query * Lint Co-authored-by: Dheeraj Manjunath <dheerajmanju1@gmail.com>
* Add is_current in additional missing spot * Fix comment * Fix broken query * Fix lint
* Upgrade libs in content-node to 1.2.80 * Add to code
* add fetch ipfs metadata timeout and optimize user indexing * remove extra logs
* Fix autocomplete regression * Actually fix
* Update SPL dependency * Fix balance indexing * Fix * Fix circular dep * Fix lint * Union type
* Process user operations in parallel, ensuring that per user operations are still handled serially to negate potential inconsistencies
* Timeout and threadpool changes * Fix retrieved_metadata bug * Fix lint * PR revisions * Lower block processing window
* Gut IPFS * Fixup * add cache log * Pin deps for flask * add colon * Put index_network_peers back + cleanup Co-authored-by: Raymond Jacobson <ray@audius.co> Co-authored-by: Isaac <isaac@audius.co>
This reverts commit a7817c0.
* Add index_blocks performance tracking * Add trailing indexing perf stats
a3d8ec6
to
1d3aeda
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for sharing this new async/await form of concurrency as well as the related blog post.
Nothing stood out as detrimental in my review and I like the new flow!
from what i've read, create_task is maybe more idiomatic but they should be functionally identical. no preference here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome – mostly just have little nits and a general request for adding types where possible. Really excited to get this in, tyyyyy for patience on slow review time
a3a4555
to
e384baa
Compare
️✅ There are no secrets present in this pull request anymore.If these secrets were true positive and are still valid, we highly recommend you to revoke them. 🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request. |
7c7a99a
to
6aee6f3
Compare
50118f1
to
5cc999a
Compare
Description
This change speeds up fetching CID metadata. Before, we were using nested thread pool executors with the requests library. This has costly overhead with making many connections to gateway endpoints for each CID and getting slow responses.
Using async here allows us to avoid blocking I/O and flattens the requests so all CID requests are made at once in a single thread and we process responses as they come in.
http://masnun.rocks/2016/10/06/async-python-the-different-forms-of-concurrency/
Tests
Tested on sandbox. Benchmarking performance fetching CID metadata for a block.
Before (changes from release branch + log)
https://github.com/AudiusProject/audius-protocol/commits/is-release-log
After:
How will this change be monitored?
Soaking on sandbox and prod. Verify CIDs are fetched, block diff is low.