Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Hasura holds open connection to metadata DB #10466

Closed
banool opened this issue Jul 18, 2024 · 3 comments
Closed

Hasura holds open connection to metadata DB #10466

banool opened this issue Jul 18, 2024 · 3 comments
Labels
k/bug Something isn't working

Comments

@banool
Copy link

banool commented Jul 18, 2024

Version Information

Server Version: 2.40.2-ce

Environment

OSS

What is the current behaviour?

We observe that each Hasura instance holds open a connection to the metadata DB for its entire life.

What is the expected behaviour?

It should only hold open a connection when it needs to, e.g. on startup, it should open a connection, read the metadata, and then close the connection. Same thing for exporting / importing / reloading metadata.

How to reproduce the issue?

N/A

Screenshots or Screencast

Please provide any traces or logs that could help here.

Any possible solutions/workarounds you're aware of?

Keywords

@banool banool added the k/bug Something isn't working label Jul 18, 2024
@ecthiender
Copy link
Member

This is due to a metadata sync mechanism among all the instances.

When there are multiple instances running, metadata can be modified by any instance. Each hasura instance keeps a connection open so it can detect if there's a new version of the metadata, and then refresh it.

@banool
Copy link
Author

banool commented Jul 19, 2024

In my experience the Hasura instances only reload metadata from the DB when you send a reload_metadata request via the metadata API. From looking at the docs I can't find a reference to this behavior or any way to configure it (e.g. the frequency), could you point that out?

@manasag
Copy link
Contributor

manasag commented Jul 22, 2024

I don't see this aspect being documented officially. But there are some notes on the schema sync process in this code https://github.com/hasura/graphql-engine/blob/master/server/src-lib/Hasura/Server/SchemaUpdate.hs#L81

Converting this thread to a discussion.

@hasura hasura locked and limited conversation to collaborators Jul 22, 2024
@manasag manasag converted this issue into discussion #10470 Jul 22, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants