Quarkus: Agroal to not log warnings for default configuration

Created on 23 Oct 2019  路  8Comments  路  Source: quarkusio/quarkus

Describe the bug
The default in Quarkus for initial-size is 0; when setting any min-size, this will produce a scary warning about

"Initial size not whithin min / max bounds"

(warning is new since #4754 )

We should either:

  • automatically set the initial-size to match the min size (when it's omitted from configuration)
  • de-emphasize the warning to info level
  • ?
arehibernate-orm areuser experience

Most helpful comment

Hi. I decided to have two messages for the cases when initial < min and initial > max, and that's why I didn't went with the words suggested by Loic. I hope the new messages are still clear enough:

Initial size smaller than min. Connections will be created when necessary

Initial size bigger than max. Connections will be destroyed as soon as they return to the pool

If not, they can be improved for the next release.

All 8 comments

Just saw this warning yesterday and think it should not be there.

+1 to set it to min size if not set

hi @loicmathieu ! happy to debate this: I was actually inclined to rather change the WARN to INFO, as talking with others they actually appreciate the fact that first connection is deferred (by defaulting to zero s initial-size):

the reason is that when spinning up multiple containers, this allows to start the app containers "in parallel" with the DB containers. It's apparently very convenient.

But I'm torn, happy to gather more opinions - just keep in mind it defaulted to zero so far: we probably shouldn't be changing the policy unless there's very strong points.

Hum I always feels uncomfortable to have a min that is not realy a min ... But I understand the rational behind it.

I always think that the order of startup is up to an orchestrator, and not everybody uses BD in containers.

If it was always the case (but the warning is new), maybe change to an INFO that explain that it's OK to have it like

"Initial size not whithin min / max bounds, setting it lower that min will allow to defer the creation of the connections to the first use of the datasource"

Maybe also setting it to more than max should be a runtime issue.

good point, I like your message proposal better. It belongs into Agroal upstream though, this is not generated by Quarkus code.

@barreiro WDYT ? ^

The warning about schema-export not closing all statements turned out to be real, although not a significant bug; will need an ORM upgrade:

@loicmathieu some updates, as I just had a chat with @gsmet on zulip about this.

So your wording suggestion didn't make it in the Agroal release, I guess too late for that - we'll be able to improve the message in the future.

Guillaume reminded me that it's not cool to log even an INFO when it relates to the default configs; we briefly considered using a logging filter but we agreed it's not the best solution.
So we decided that it's actually the min-size which should default to zero. I hope you agree as well: people can easily switch it, and it's better inline with the cloud-native spirit.

PR is open now.

@Sanne I usually set the min size to 3 or 5 but in the cloud 0 have sense.
I wonder what is the cost to establish a connection in Agroal but I now that on some database it's not negligible (Oracle start an OS process for each connection for example)

But as usual it's a compromise and I'm ok with it.

Hi. I decided to have two messages for the cases when initial < min and initial > max, and that's why I didn't went with the words suggested by Loic. I hope the new messages are still clear enough:

Initial size smaller than min. Connections will be created when necessary

Initial size bigger than max. Connections will be destroyed as soon as they return to the pool

If not, they can be improved for the next release.

Was this page helpful?
0 / 5 - 0 ratings