question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ConfigSource run in the async mode

See original GitHub issue

Description

Recently the vault config source has moved to vertx (instead of okhttp client). The vault config source has the ability to refresh itself periodically. We had issue #16021 where properties were attempted to be refreshed in a non blocking thread. Although calls to vault using the vertx client could return Uni, we are limited by the ConfigSource interface that requires a plain Map<String, String>. The question here is whether the config source mechanism could be reactive friendly.

An alternative idea is to get a global timer responsible for calling periodically config sources and get them a chance to refresh their cache (if they do implement one). that way we could be blocking on this thread, and if we use non blocking data structures for the different caches, the applicative threads would never be blocked, and never attempt to call vault as a result of getting a config source property injected.

/cc @radcortez @sberyozkin

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sberyozkincommented, Mar 26, 2021

Timer with a configurable poll interval is in interesting option IMHO, as making ConfigSource reactive may be tricky

0reactions
vsevelcommented, Mar 30, 2021

@sberyozkin I was thinking more about a central timer facility, where you could register your periodic tasks. the timer facility would be general purpose, not dedicated to config sources. I am surprised actually that none of the existing extensions have already expressed the need. the use case does not exist, or everybody is doing its own ScheduledExecutorService ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application — Kivy 2.2.0.dev0 documentation
To run a Kivy app asynchronously, either the async_runTouchApp() or App.async_run() coroutine must be scheduled to run in the event loop of the...
Read more >
nextConfig issue while building or running the project #39161
NextConfig} */ const nextConfig = { async redirects() { return [ { source: ... service-worker.js', register: true, runtimeCaching, mode: ...
Read more >
Mocha tests for asynchronous functions - Stack Overflow
If you're testing asynch code you'll need to use the done pattern: ... callsArgOnWithAsync(2, configSource, JSON.parse(jsonConfig)) afterEach ...
Read more >
Sync Platform - Scrapli Cfg
Scrapli Config base class Args: conn: scrapli connection to use config_sources: list of config sources on_prepare: optional callable to run at connection ...
Read more >
Using Separate Files for Config Sections - mojoPortal
NET application to find the actual configuration for the section in another file. Use of configSource in a few sections of the mojoPortal...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found