graphprotocol / graphprotocol/graph-node
Priority of toml config vs env vars for connection pool size
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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