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

Allow Reporting endpoints more time to respond #737

Closed
wants to merge 1 commit into from

Conversation

tahb
Copy link
Contributor

@tahb tahb commented Nov 13, 2023

Context

We’re finding these endpoints can take more than 30 seconds to respond. This is understandable as the data they’re loading on demand is big.

A longer term solution will be to move this reports from being on demand and to being generated in advance. This will take more time that we have left to do at this point so we try to find a compromise.

The timeout of RestClient doesn’t seem configurable from the reports controller. This might have be a cleaner option rather than repeating the API config.

Changes in this PR

Requests to the API for reports have their timeout extended to 50 seconds. Giving the API 20 more seconds to respond as it itself timeouts after 60s.

Release checklist

Release process documentation.

Pre-merge checklist

  • Are any changes required to dependent services for this change to work?
    (eg. CAS API)
  • Have they been released to production already?

Post-merge checklist

@tahb tahb requested a review from libuk November 13, 2023 14:20
@tahb tahb force-pushed the fix/allow-report-endpoint-longer-to-respond branch 2 times, most recently from f59266e to 4bb389e Compare November 13, 2023 14:35
We’re finding these endpoints can take more than 30 seconds to respond. This is understandable as the data they’re loading on demand is big.

A longer term solution will be to move this reports from being on demand and to being generated in advance. This will take more time that we have left to do at this point so we try to find a compromise.

The timeout of RestClient doesn’t seem configurable from the reports controller. This might have be a cleaner option rather than repeating the API config.
@tahb tahb force-pushed the fix/allow-report-endpoint-longer-to-respond branch from 4bb389e to 78dbfa4 Compare November 13, 2023 14:41
response: 50000,
deadline: 50000,
},
agent: new AgentConfig(Number(get('COMMUNITY_ACCOMMODATION_API_TIMEOUT_RESPONSE', 40000))),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason this value is 40 seconds as opposed to 50?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it should be 50 thanks! 😬

@tahb
Copy link
Contributor Author

tahb commented Nov 14, 2023

We might not need this if ministryofjustice/hmpps-approved-premises-api#1134 + the re-addition of personal data columns ends with good performance 🤞

@tahb
Copy link
Contributor Author

tahb commented Nov 17, 2023

Don't need this anymore :)

@tahb tahb closed this Nov 17, 2023
@tahb tahb deleted the fix/allow-report-endpoint-longer-to-respond branch November 17, 2023 16:33
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