allegro / turnilo

Business intelligence, data exploration and visualization web application for Druid, formerly known as Swiv and Pivot
https://allegro.github.io/turnilo/
Apache License 2.0
728 stars 170 forks source link

Settings load timeout #766

Open tanisdlj opened 3 years ago

tanisdlj commented 3 years ago

Hi! We're hitting a timeout when we start the service

Introspecting all sources in cluster 'druid'
Settings load timeout (800ms) hit, continuing
Settings load timeout (800ms) hit, continuing
Settings load timeout (800ms) hit, continuing

It's not super critical, but makes the "full start" of turnilo a bit slower. Any clue why this might be happening? Is it a bug or a problem on my config?

Thanks a lot!

adrianmroz-allegro commented 3 years ago

Hi!

To be sure, don't you have messages like following, before one you posted?

Adding cluster manager for 'druid' with X dataCubes
Connected to cluster 'druid'

If that's the case, this is what happens:

Turnilo starts, reads your config file, but also tries to fetch metadata from druid cluster. This is safety check, so turnilo won't display non existing data cubes.

But if this metadata fetch takes a lot of time (timeout is hit), turnilo just returns settings from configuration. But fetch is handled in the background and after successful request, turnilo will get this metadata, and next client would get correct configuration.

I don't think that slows turnilo startup - you still need to get those metadata. If you wan't more predictable behaviour, you can increase this timeout - set pageMustLoadTimeout in your config file to number of milliseconds.

There is also another possibility, but less likely. Maybe you have some health check service that hits turnilo during startup? It could also hit this timeout before even metadata fetch occurs. In that case, you just need to let turnilo start a little longer :)

To be honest, we would also benefit from "configuration as a source of truth" mode, where no metadata fetch is needed. But we don't have resources to implement this and still keep legacy behaviour :(

tanisdlj commented 3 years ago

Thanks! I'll look into that. By the way, the setting pageMustLoadTimeout is not documented in turnilo/docs/configuration-cluster.md, it would be nice to add it there

adrianmroz-allegro commented 3 years ago

By the way, the setting pageMustLoadTimeout is not documented in turnilo/docs/configuration-cluster.md, it would be nice to add it there

Good catch!