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

Potential timeout error #136

Open
ThomasJejkal opened this issue May 1, 2023 · 3 comments · Fixed by #218
Open

Potential timeout error #136

ThomasJejkal opened this issue May 1, 2023 · 3 comments · Fixed by #218
Assignees
Labels
documentation Improvements or additions to documentation maintenance Not a bug, but should be done.
Milestone

Comments

@ThomasJejkal
Copy link
Contributor

Describe the bug
I ran into this issue while operating the Typed PID Maker behind a Spring Cloud Gateway, but it may occur in all setups. The issues occurs if creating a Typed PID with "many" unknown types the first time. The Typed PID Maker resolves all types and caches them for subsequent calls. However, the first time a type occurs will cause some delay and multiple of these delays may sum up to the configured timeout for a single call. In my example, the response timeout was set to 5 seconds, which was hit reliably e.g. for PID Records with 10 previously unknown types.

As a suggestion I would document to increase the timeout to a much higher amount, e.g., 30 or 60 seconds, to be on the safe side.

@ThomasJejkal ThomasJejkal added the documentation Improvements or additions to documentation label May 1, 2023
@Pfeil Pfeil modified the milestones: 1.2.0, 1.1.0 May 2, 2023
@Pfeil Pfeil modified the milestones: 1.1.0, 2.0.0 Jun 2, 2023
@Pfeil
Copy link
Member

Pfeil commented Jun 2, 2023

Just to clarify: The timeout appeared in a configured HTTP reverse-proxy in the setup (or the Spring Cloud Gateway, in this case), not in the Typed PID Maker (configuration), right? The Typed PID Maker itself should not time out, of course.

There are two "heavy" things that happen on validation:

  1. http requests (to the DTR // resolving records) take relatively long and benefit a lot from asynchronous execution
  2. JSON validation
  • the validation of each attribute is independent of the other attributes. It should be easy and beneficial to parallelize or use asynchronous code.
  • by far not as heavy as http requests as everything is very fast if the cache is filled. The issue is definitely the amount of requests and maybe parsing/serializing the responses.

TODO

@Pfeil Pfeil modified the milestones: 2.0.0, 2.0.1 Jun 2, 2023
@Pfeil Pfeil added the maintenance Not a bug, but should be done. label Jun 28, 2023
@Pfeil
Copy link
Member

Pfeil commented Jan 13, 2025

A full rewrite using async and virtual threads, as well as several optimizations, is being done in #218. It also implements Schema Generators, which I believe could be interesting for #179. I hope I'll find the time to do some proper benchmarks between main (2.x) and #218 (which will likely result in v3.0.0 or so, as we consider removing implicit profile validation for compatibility reasons with other project and make it optional/explicit).

@Pfeil Pfeil linked a pull request Jan 13, 2025 that will close this issue
38 tasks
@Pfeil
Copy link
Member

Pfeil commented Jan 22, 2025

Just a small remark that I consider the performance issue basically solved with #218, and it will land in a soonish available version. Usual performance on machine is 180ms with empty cache, and 3-5ms using the default configuration. It is not fully decided yet if it makes into the 2.x series or the 3.0.0 preview which we are planning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation maintenance Not a bug, but should be done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants