-
Notifications
You must be signed in to change notification settings - Fork 38
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(ihe): stream responses to response endpoints + epic bigger doc r… #2306
Conversation
…ef chunks Refs: #1667 Signed-off-by: Jonah Kaye <[email protected]>
@@ -17,7 +17,7 @@ dayjs.extend(duration); | |||
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 }); | |||
const MAX_GATEWAYS_BEFORE_CHUNK = 1000; | |||
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20; | |||
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20; | |||
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 10; |
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.
we are upping docRefs per req from 5-10 (only for epic but thats 98% of our docs so lets just treat it like that for everything) so to make sure we stay under the lambda payload size limit lets half the number of gateways per request.
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.
Might make sense to ultimately flatten this logic so that there's a single request count per lambda invocation.
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 think this would be especially good for DR, yeah.
I see the benefit of grouping a bunch of XCPDs in a single lambda request (no much memory/timeout issue), but to download a file, a single lambda invocation seem to make sense.
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.
ok I think this concern needs more consideration and is beyond the scope of the PR. There are a bunch of other considerations to take into account:
- cost
- concurrency limits
- complete reworking of querrying architecture to be queue based
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.
Moving DRs to individual ones has nothing to do with (3) and (2).
For (2), we have 1,000 concurrent lambda executions and we can ask to increase this limit to 10's of 1,000 (source).
For (3), there's no requirement to add queues in order to break them down.
For. (1)/cost, this might impact, but it would make each single invocation shorter - and lambdas are cheap, it doesn't even make it to the top 10 costs we have.
Not saying we have to do it here, just addressing the justifications.
Refs: #1667 Signed-off-by: Jonah Kaye <[email protected]>
Refs: #1667 Signed-off-by: Jonah Kaye <[email protected]>
Refs: #1667 Signed-off-by: Jonah Kaye <[email protected]>
Refs: #1667 Signed-off-by: Jonah Kaye <[email protected]>
@@ -16,4 +16,4 @@ export const namespaces = { | |||
xsiType: "xsd:string", | |||
}; | |||
|
|||
export const expiresIn = 5; | |||
export const expiresIn = 20; |
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.
need saml timestamp to last longer!
5 mins too short if we are doing retries with the same request
@@ -17,7 +17,7 @@ dayjs.extend(duration); | |||
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 }); | |||
const MAX_GATEWAYS_BEFORE_CHUNK = 1000; | |||
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20; | |||
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20; | |||
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 10; |
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.
Might make sense to ultimately flatten this logic so that there's a single request count per lambda invocation.
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/outbound/xcpd/process/error.ts
Outdated
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Outdated
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Outdated
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/ihe-gateway-v2-logic.ts
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/outbound/xcpd/process/error.ts
Outdated
Show resolved
Hide resolved
packages/core/src/external/carequality/ihe-gateway-v2/gateways.ts
Outdated
Show resolved
Hide resolved
@@ -17,7 +17,7 @@ dayjs.extend(duration); | |||
const SLEEP_IN_BETWEEN_DOCUMENT_RETRIEVAL_REQUESTS = dayjs.duration({ seconds: 1 }); | |||
const MAX_GATEWAYS_BEFORE_CHUNK = 1000; | |||
const MAX_DOCUMENT_QUERY_REQUESTS_PER_INVOCATION = 20; | |||
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 20; | |||
const MAX_DOCUMENT_RETRIEVAL_REQUESTS_PER_INVOCATION = 10; |
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 think this would be especially good for DR, yeah.
I see the benefit of grouping a bunch of XCPDs in a single lambda request (no much memory/timeout issue), but to download a file, a single lambda invocation seem to make sense.
Refs: #1667 Signed-off-by: Jonah Kaye <[email protected]>
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! 🚀
It'd be good to keep the convo about single lambda invocation for DR somewhere else (it would be bad to lose a large XML file w/ lots of resources b/c the lambda ran out of memory from downloading multiple files in a single invocation.
Refs: #1667
Downstream
Description
Testing
Release Plan