Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A new config loader that can monitor config changes #1351

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Apr 3, 2024

A new config loader that can monitor config changes

Copy link

github-actions bot commented Apr 3, 2024

Test Results

 92 files  ± 0   92 suites  ±0   10m 33s ⏱️ -4s
 71 tests  -  8   62 ✅  - 15  2 💤 ±0   7 ❌ + 7 
195 runs   - 10  174 ✅  - 25  6 💤 ±0  15 ❌ +15 

For more details on these failures, see this check.

Results for commit c342115. ± Comparison against base commit ae19c06.

This pull request removes 12 and adds 4 tests. Note that renamed tests count towards both.
dev.restate.e2e.JavaKafkaIngressTest ‑ handleEventInCounterService(URL, int, IngressClient)
dev.restate.e2e.JavaKafkaIngressTest ‑ handleEventInEventHandler(URL, int, IngressClient)
dev.restate.e2e.JavaNonDeterminismTest ‑ backgroundInvokeWithDifferentTargets
dev.restate.e2e.JavaNonDeterminismTest ‑ callDifferentMethod
dev.restate.e2e.JavaNonDeterminismTest ‑ leftSleepRightCall
dev.restate.e2e.JavaNonDeterminismTest ‑ setDifferentKey
dev.restate.e2e.NodeKafkaIngressTest ‑ handleEventInCounterService(URL, int, IngressClient)
dev.restate.e2e.NodeKafkaIngressTest ‑ handleEventInEventHandler(URL, int, IngressClient)
dev.restate.e2e.NodeNonDeterminismTest ‑ backgroundInvokeWithDifferentTargets
dev.restate.e2e.NodeNonDeterminismTest ‑ callDifferentMethod
…
dev.restate.e2e.JavaKafkaIngressTest ‑ initializationError
dev.restate.e2e.JavaNonDeterminismTest ‑ initializationError
dev.restate.e2e.NodeKafkaIngressTest ‑ initializationError
dev.restate.e2e.NodeNonDeterminismTest ‑ initializationError

♻️ This comment has been updated with latest results.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for creating this PR @AhmedSoliman. The changes look good to me. I had one question concerning the config-watcher thread and whether this could be fused with the debouncer event handler. Apart from this, looking pretty much forward to having a dynamically loadable configuration :-)

Comment on lines +118 to +139
std::thread::Builder::new()
.name("config-watcher".to_owned())
.spawn(move || {
// It's important that we capture the watcher in the thread,
// otherwise it'll be dropped and we won't be watching anything!
let _debouncer = debouncer;
info!("Configuration watcher thread has started");
let mut should_run = true;
while should_run {
match rx.recv() {
Ok(evs) => {
self.handle_events(evs);
}
Err(e) => {
error!("Cannot continue watching configuration changes: '{}!", e);
should_run = false;
}
}
}
info!("Config watcher thread has terminated");
})
.expect("start config watcher thread");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the main purpose of this additional thread? Could we move self.handle_events into the DebounceEventResult handler?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this be redesigned to be return a guard that holds the debouncer, but I took the shortest path to get something to work tbh.

@AhmedSoliman AhmedSoliman merged commit 027b8cd into main Apr 4, 2024
8 checks passed
@AhmedSoliman AhmedSoliman deleted the pr1351 branch April 4, 2024 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants