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

Investigate lazy loading of ResultSet in PatientPrimaryPhoneDataLoader #3953

Closed
emmastephenson opened this issue Jul 7, 2022 · 0 comments · Fixed by #4056
Closed

Investigate lazy loading of ResultSet in PatientPrimaryPhoneDataLoader #3953

emmastephenson opened this issue Jul 7, 2022 · 0 comments · Fixed by #4056

Comments

@emmastephenson
Copy link
Collaborator

emmastephenson commented Jul 7, 2022

Background

One of our prod containers crashed on 7/7/22 because there were a number of DataFetcherExceptions returned from a database query. The root cause of this was that we were trying to send too many bind variables with a single query, and specifically trying to request ResultSet when using the PatientPrimaryPhoneDataLoader.

Action requested

  • Research why ResultSet is being requested as part of the PatientPrimaryPhoneDataLoader at all
  • See if this is related to a single graphQL query (my guess is some kind of test result list query, because there were many /testResults[1234]/patient/telephone queries all back to back.)
  • Either break up the initial query to request less information (may not be feasible) or stop lazy-loading the ResultSet for patient phone number

Acceptance Criteria

[guessing here] We can successfully execute a query to get the test result list for an organization that has over 15,000 testEvents without hitting a postgreSQL exception.

Additional context

StackOverflow about the cap on data binds: https://stackoverflow.com/questions/49274390/postgresql-and-hibernate-java-io-ioexception-tried-to-send-an-out-of-range-inte
pgjdbc Github post about the same issue: pgjdbc/pgjdbc#1311
Our container log stack trace: https://gist.github.com/emmastephenson/cba394abeed60980ae1313c5bddd46a2
Original page about long-running database queries: https://prime-cdc.pagerduty.com/incidents/Q1ZAL63CY41CDZ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants