-
Notifications
You must be signed in to change notification settings - Fork 8
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
chore: Incorporate Proto Definition Changes For Reduce #52
Conversation
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
src/error.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thiserror will make life much easier here
let map_svc = MapService { handler }; | ||
|
||
// Create a channel to send shutdown signal to the server to do graceful shutdown in case of non retryable errors. | ||
let (internal_shutdown_tx, internal_shutdown_rx) = mpsc::channel(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget, why not oneshot?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to store that as a variable inside the ReduceService struct for it to be used inside the reduce_fn function. Since oneshot is not cloneable, I had to opt for the mpsc method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment there?
use tracing::info; | ||
|
||
// #[tracing::instrument(skip(path), fields(path = ?path.as_ref()))] | ||
#[tracing::instrument(fields(path = ?path.as_ref()))] | ||
#[tracing::instrument(fields(path = ? path.as_ref()))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#[tracing::instrument(fields(path = ? path.as_ref()))] | |
#[tracing::instrument(fields(path = ?path.as_ref()))] |
src/shared.rs
Outdated
let custom1 = async { | ||
internal_rx.recv().await; | ||
}; | ||
|
||
let custom2 = async { | ||
if let Some(rx) = user_rx { | ||
rx.await.ok(); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this?
src/shared.rs
Outdated
assert!(contents.contains("\"language\":\"rust\"")); | ||
assert!(contents.contains("\"version\":\"0.0.1\"")); | ||
assert!(contents.contains("\"metadata\":{}")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use r#""#
?
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Yashash H L <[email protected]>
src/sourcetransform.rs
Outdated
.await?; | ||
|
||
// cleanup the socket file after the server is shutdown | ||
// UnixListener doesn't implement Drop trait, so we have to manually remove the socket file | ||
let _ = fs::remove_file(&self.sock_addr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will not remove the file if we short-circuit using ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this, totally missed that case.
Signed-off-by: Yashash H L <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
Signed-off-by: Vigith Maurice <[email protected]>
I will create a follow-up PR to review error handling in services, excluding 'reduce'. Currently, if the user code has a panic, it is not being propagated back in 'map'. |
fixes #46