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

chore: Incorporate Proto Definition Changes For Reduce #52

Merged
merged 40 commits into from
Jun 29, 2024
Merged

Conversation

yhl25
Copy link
Contributor

@yhl25 yhl25 commented May 29, 2024

fixes #46

@yhl25 yhl25 marked this pull request as ready for review May 30, 2024 05:07
@yhl25 yhl25 requested a review from vigith May 30, 2024 05:07
Signed-off-by: Yashash H L <[email protected]>
@yhl25 yhl25 requested a review from BulkBeing May 30, 2024 05:07
yhl25 and others added 10 commits May 30, 2024 14:31
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]>
@yhl25 yhl25 marked this pull request as draft June 3, 2024 15:06
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]>
src/error.rs Outdated
Copy link
Member

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);
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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()))]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[tracing::instrument(fields(path = ? path.as_ref()))]
#[tracing::instrument(fields(path = ?path.as_ref()))]

src/shared.rs Outdated
Comment on lines 78 to 86
let custom1 = async {
internal_rx.recv().await;
};

let custom2 = async {
if let Some(rx) = user_rx {
rx.await.ok();
}
};
Copy link
Member

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
Comment on lines 163 to 166
assert!(contents.contains("\"language\":\"rust\""));
assert!(contents.contains("\"version\":\"0.0.1\""));
assert!(contents.contains("\"metadata\":{}"));
Copy link
Member

Choose a reason for hiding this comment

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

use r#""#?

yhl25 and others added 8 commits June 25, 2024 20:40
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]>
@yhl25 yhl25 marked this pull request as ready for review June 27, 2024 06:52
@yhl25 yhl25 requested a review from vigith June 27, 2024 06:53
Comment on lines 340 to 344
.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);
Copy link
Member

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 ?

Copy link
Contributor Author

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.

@yhl25
Copy link
Contributor Author

yhl25 commented Jun 29, 2024

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'.

@yhl25 yhl25 requested a review from vigith June 29, 2024 13:30
@yhl25 yhl25 merged commit 7dff517 into main Jun 29, 2024
2 checks passed
@yhl25 yhl25 deleted the fix-reduce branch June 29, 2024 14:38
@vigith vigith mentioned this pull request Jun 29, 2024
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.

Incorporate Proto Definition Changes For Reduce
2 participants