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

[4.24.0] Multiple health checks after one action (save/delete) #20216

Closed
yanckst opened this issue Apr 26, 2024 · 7 comments
Closed

[4.24.0] Multiple health checks after one action (save/delete) #20216

yanckst opened this issue Apr 26, 2024 · 7 comments
Labels
status: will not fix Won't fix as it's either intended or for some other reason

Comments

@yanckst
Copy link

yanckst commented Apr 26, 2024

Bug report

Required System information

  • Node.js version: 20.10.0
  • NPM version: yarn 1.22.21
  • Strapi version: v4.24.0
  • Database: sqlite
  • Operating system: Windows 10
  • Is your project Javascript or Typescript: Typescript
┌────────────────────┬──────────────────────────────────────────────────┐
│ Time               │ Fri Apr 26 2024 10:23:25 GMT-0400 (heure avancé… │
│ Launched in        │ 2108 ms                                          │
│ Environment        │ development                                      │
│ Process PID        │ 12120                                            │
│ Version            │ 4.24.0 (node v20.10.0)                           │
│ Edition            │ Community                                        │
│ Database           │ sqlite                                           │
└────────────────────┴──────────────────────────────────────────────────┘

Describe the bug

When saving or deleting a component or a collection, multiples /_health checks are done after each action. On localhost it's 'fine', but in the cloud, resources are limited causing the server to be refreshed at a longer time and causing the server to crash, sometimes.

Steps to reproduce the behavior

  1. Create a strapi app by using yarn create strapi-app my-strapi-project --typescript
  2. When the app is deployed locally, create a first user
  3. When the user is configured, navigate to the Content-type Builder
  4. Create a component with any name
  5. Inside that component create a textbox field with any name
  6. Save the component

Actual behavior

Multiple /_health checks are done in the Network tab and some of them are failing.

Expected behavior

At least one /health check should be done, not multiple ones.

Screenshots

image

2024-04-26_10-33-07

2024-04-26_10-42-36
Notice also that after the delete, I needed to refresh the page to see that the component is deleted.

2024-04-26_10-44-45

Code snippets

Not applicable

Additional context

Question

Is it possible to turn off the /_health checks when doing an action in Strapi?

@joshuaellis
Copy link
Member

The server restarts when you make changes to your content structure, the health checks are there by design to know when the client can reconnect and work again.

@yanckst
Copy link
Author

yanckst commented Apr 26, 2024

Okay, I understand, but why so many calls for one action?

I was expecting one health check for one action (to check if the server is running and is healthy), but seeing all the same health checks at the same period of time doesn't really make sense. It will impact the performance by doing all those calls.

@joshuaellis
Copy link
Member

If the server restarts and you make one call it'll fail, how do you propose we then find out it it's restarted?

@yanckst
Copy link
Author

yanckst commented Apr 26, 2024

Before doing any health checks, we log and keep the current request with all the information about the request. We can add this request to a list, DB or something. This list will contain all pending requests.

When doing the health check, we check if there's already a failed request. If so, we try to process the failed request and we repeat this process within a maximum amount of tries. (can be configured in the settings) before starting a new request. I don't know if there's already a retry mechanism for that feature.

If the check is valid, we can continue normally on the app and remove pending requests.

If the check is still invalid and we reach the maximum of tries, we can fallback to the ErrorFlow. It could be showing an error to the user and he might need to redo his actions, etc.

@joshuaellis
Copy link
Member

How do you plan to keep the pending requests in the DB if the server is restarting and therefore unable to take any request? Sorry I might have misunderstood your proposal.

@yanckst
Copy link
Author

yanckst commented Apr 29, 2024

I don't know how you can do it, but something with a try mechanism/backoff transaction, notification system, etc

Here's the problem with a cloud infrastructure, not a local app.

The app is deployed in the cloud and using a MySQL database.

You can see the health checks is very aggressive. Sometimes the server crashes and we need to restart it.

2024-04-29_09-07-25.mp4

If there's no way for a quick fix, can we disable temporary the health check using a configuration or something?

I didn't find anything in the doc regarding that.

Thanks!

PS I also tested the strapi-beta5 as well and it does the same thing

@derrickmehaffy
Copy link
Member

You are using development mode in a deployed environment which we do not support.

You should even be able to modify the schema while it's deployed.

Closing this as won't fix since it wouldn't be a problem locally and that's the only place you should be using the content-type builder.

@derrickmehaffy derrickmehaffy added the status: will not fix Won't fix as it's either intended or for some other reason label Apr 29, 2024
@derrickmehaffy derrickmehaffy closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: will not fix Won't fix as it's either intended or for some other reason
Projects
Status: Done
Development

No branches or pull requests

3 participants