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

Doc should discourage users from writing long-running code in hooks called from Helidon-provided services #3152

Closed
tjquinno opened this issue Jun 24, 2021 · 2 comments

Comments

@tjquinno
Copy link
Member

Environment Details

  • Helidon Version: 2.x
  • Helidon SE or Helidon MP
  • JDK version:
  • OS:
  • Docker version (if applicable):

Problem Description

Currently, the handlers for some Helidon-provided endpoints (e.g., metrics and OpenAPI) do their work synchronously, using the same thread on which the request arrived via Netty. The documentation should make this clear and strongly discourage developers from including long-running code of their own via hooks that can be invoked by those handlers.

For example, a user-provided metric's code to format the metrics as JSON or Prometheus will be invoked as Helidon responds to the /metrics endpoint. Similarly, users can provide their own code that participates in building the in-memory OpenAPI model.

By contrast, the handler for the health endpoint prepares the response asynchronously.

It seems unnecessary to convert the other endpoint handlers to also respond asynchronously, as it would be unusual for user code invoked by those handlers to be long-running. But at the least the doc should warns users about this and steer them away from writing long-running code in these places.

@ljamen
Copy link
Contributor

ljamen commented Jul 27, 2021

Draft PR #3226

@ljamen ljamen closed this as completed Aug 5, 2021
@ljamen
Copy link
Contributor

ljamen commented Aug 5, 2021

PR approved. Closing issue.

@m0mus m0mus added this to Backlog Aug 12, 2024
@m0mus m0mus moved this to Closed in Backlog Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants