-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: handle messages concurrently in pickup worker #119
Conversation
WIP - switch to an sqs lib that polls for new messages concurrently rather than in batches - rewrite pickup worker so we can compose it out of single-responsibilty pieces instead of having to pass through the giant config ball. License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
View stack outputs
|
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
test the api is available when start is called. License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
CMD [ "npm", "start", "-w", "pickup", "--silent"] |
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.
put less npm noise in the logs
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
fixes #101 License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
Stack outputs updated
|
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
2 mins is still timeout after node restarts License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
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.
LGTM! Great work @olizilla , as you mentioned things got way simpler and make better use of each container 🙌🏼 Also nice finding with squiss
SQS Poller, much nicer!
Leaving some non blocking feedback below. Would also be great if follow up PRs would be more scoped, instead of such big code changes when possible.
README.md
Outdated
2/3rs of home internet users can upload faster than 20Mbit/s (fixed broadband), at which 32GiB would transfer in 3.5hrs. | ||
|
||
see: https://www.speedtest.net/global-index | ||
see: https://www.omnicalculator.com/other/download-time?c=GBP&v=fileSize:32!gigabyte,downloadSpeed:5!megabit |
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.
Shouldn't this be a note in the subsection above? ### FETCH_TIMEOUT_MS
@@ -16,12 +16,12 @@ | |||
"@aws-sdk/lib-dynamodb": "^3.112.0", | |||
"@aws-sdk/lib-storage": "^3.97.0", | |||
"@ipld/car": "5.1.0", | |||
"async-retry": "1.3.3", |
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.
cool that we moved to p-*
👍🏼
*/ | ||
export async function fetchCar (cid, ipfsApiUrl, downloadError, timeoutMs = 30000, downloadStatusManager) { | ||
export async function fetchCar ({ cid, ipfsApiUrl, signal }) { |
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.
Should we do default for ipfsApiUrl like below?
if (!msg.isHandled) { | ||
await msg.release() // back to the queue, try again | ||
} |
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 like we do release everywhere? Should we put this after the else instead?
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.
i'm likely to bring back "directly update pin status in db and fail where dag is too big" so left it so that each condition decides what to do with the message.
License: MIT Signed-off-by: Oli Evans <oli@protocol.ai>
sqsPoller
+carFetcher
+s3Uploader
see: https://github.com/PruvoNet/squiss-ts/
fixes #13
fixes #116
fixes #101
License: MIT