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

ADR about Application Context Supporting Different Implementations Per Thread #1690

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

halprin
Copy link
Member

@halprin halprin commented Jan 14, 2025

Description

Wrote an ADR about the enhancement made to ApplicationContext and a bit about load testing.

Issue

#1122.

Checklist

  • I have updated the documentation accordingly

Copy link

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

1122 - Partially compliant

Fully compliant requirements:

  • Sign Flexion and CDC up for the Locust preview program.
  • Implement load test in internal including authentication against the token endpoint, testing other endpoints, and ensuring it works for longer durations and locally.
  • Set up a GitHub Action to run tests on a schedule.
  • Update existing ADR and/or create new one.
  • Update readme with how to run and modify load tests in deployed environments.
  • Configure test criteria in Azure.
  • Add comments to app context and places where .getImplementation is used instead of @Inject.
  • Investigate metadata endpoint failure in load test.
  • Look into why failing to link metadata results in 5XXs.
  • Set up mock RS endpoints for load testing.
  • Rename internal load testing.

Not compliant requirements:

  • ADR about setting the per-thread RS implementation when a new API call is created that calls RS.
  • Look at why load tests cause 499s again.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Complexity Concern

The new ApplicationContext#registerForThread method introduces complexity and potential for bugs, especially in multithreaded environments. This needs careful review to ensure it doesn't introduce concurrency issues.

A new method was added called `ApplicationContext#registerForThread`.

Copy link

PR Code Suggestions ✨

No code suggestions found for the PR.

Because each HTTP request is handled on its own thread, we are able to change the ReportStream client implementation
between the real one or a mock one depending on whether a load test HTTP request header is passed in or not.

A new method was added called `ApplicationContext#registerForThread`.
Copy link
Contributor

Choose a reason for hiding this comment

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

That's pretty cool

@halprin halprin merged commit a049ca6 into main Jan 14, 2025
17 checks passed
@halprin halprin deleted the issue-1122-adr branch January 14, 2025 16:27
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.

2 participants