graphprotocol / graphprotocol/graph-node

Priority of toml config vs env vars for connection pool size

Open
#3,977 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
3.2k
Forks
1.1k
Avg merge
4d 1h
Merged PRs (30d)
1

Description

Do you want to request a feature or report a bug?

Neither

What is the current behavior?

It seems that setting the size of a connection pool with the config file takes precedence over using STORE_CONNECTION_POOL_SIZE.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Start a graph node which uses

[store]
[store.primary]
connection = "<%= pgString %>"
pool_size = [
{ node = ".*", size = 30 },
]

and start the node with STORE_CONNECTION_POOL_SIZE=50. Then check the pool size using graphman and see that the config takes precedence.

What is the expected behavior?

I would expect the env var to take precedence over the config. Though I understand the env var isn't as fine grained.

Maybe I'm misunderstanding what STORE_CONNECTION_POOL_SIZE is meant for relative to pool_size in [store]?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the configuration using the TOML [store.primary] pool_size setting and STORE_CONNECTION_POOL_SIZE=50, then inspect the resulting pool size with graphman. Determine the intended precedence between the fine-grained pool_size setting and the environment variable, and verify the chosen behavior with a focused test or documented result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.