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

Add check for large for loops #361

Merged
merged 2 commits into from
Mar 16, 2022
Merged

Conversation

BoyaWu10
Copy link
Contributor

@BoyaWu10 BoyaWu10 commented Mar 14, 2022

By offline discussion, we are going to limit the number of the list in the for loop by the maxIterations parameter provided by dotliquid. Currently the value is set to 100000.

@@ -18,6 +18,7 @@ namespace Microsoft.Health.Fhir.Liquid.Converter.Processors
public abstract class BaseProcessor : IFhirConverter
{
private readonly ProcessorSettings _settings;
private const int _maxIterations = 100000;
Copy link
Contributor

@qiwjin qiwjin Mar 16, 2022

Choose a reason for hiding this comment

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

can you help doc this limitation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @ginalee-dotcom, could you please help create a PR to update the document about this change? The maximum iteration of for-loop in liquid templates is now set to 100,000. Previously there's no limitation about this. If the limitation is reached, an exception will be thrown with detailed message. This is to help make sure our engine returns a result in time.

@BoyaWu10 BoyaWu10 merged commit 3bc3440 into dotliquid Mar 16, 2022
@BoyaWu10 BoyaWu10 deleted the personal/boywu/maxIterations branch March 16, 2022 08:31
jakiefermsft added a commit to jasonheld-msft/FHIR-Converter that referenced this pull request Apr 26, 2022
…fer/pgcritiques-merge

* 'main' of github.com:microsoft/FHIR-Converter:
  Global Readiness Manifest file GeoPol.xml
  Update version (microsoft#375)
  Remove blank lines (microsoft#374)
  Update Doc for Filters  (microsoft#365)
  Switch FormatAsDateTime timezone handling to preserve to maintain consistency (microsoft#358)
  Revert "reset to local (microsoft#368)"
  reset to local (microsoft#368)
  Phase -2, Milestone-3 Mapping (microsoft#366)
  Change Default Time Zone Handling (microsoft#363)
  Turn on mac functional test check (microsoft#367)
  Fix warnings (microsoft#364)
  Fix Time Zone Bug (microsoft#353)
  Phase2 - Milestone 1&2 Mapping (microsoft#354)
  Add check for large for loops (microsoft#361)
  Updated the logic of checking the number of default templates
  Update pipeline win host version (microsoft#359)
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.

6 participants