Repository navigation
fix(fhirpath): evaluate aggregate() iterations in a child of the caller's context - #2967
Open
angela-helios wants to merge 1 commit into
Open
angela-helios wants to merge 1 commit into
angela-helios wants to merge 1 commit into
Conversation
…er's context Each aggregate() iteration ran in a fresh empty context, so the terminology call budget, answer cache and rate-limit hold restarted every iteration, and the caller's terminology server and resources were lost. Iterations now run in create_child_context(), sharing all three, as where() and select() lambdas do. Closes #2966
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2966
Summary
aggregate()evaluated each iteration inEvaluationContext::new_empty. Every iteration therefore got:FHIRPATH_TERMINOLOGY_MAX_CALLSbudget, the answer cache and the rate-limit hold started from zero;FHIRPATH_TERMINOLOGY_SERVERor failing;Each iteration now runs in
context.create_child_context(), as the lambdas ofwhere()andselect()do. The child shares the session, the server and the resources, and reaches the caller's variables through its parent chain.$totalis still set per iteration, andcurrent_indexis cleared as before.Tests
terminology_functions::tests::aggregate_iterations_share_the_terminology_budget: with a budget of 2,('a' | 'b' | 'c' | 'd').aggregate($this.memberOf(VS))(three evaluated iterations) stops withTerminologyCallLimitafter two requests to the stub server.With the change stashed, the test fails: the iterations have no terminology server at all ("No terminology server is configured"), which is the second half of the bug.
cargo test -p helios-fhirpath: 797 passed, the R4 conformance cases foraggregate()included. Clippy onhelios-fhirpath --all-targetsis clean.