-
Notifications
You must be signed in to change notification settings - Fork 4
fix: reduce parallelism in default config creation and improved logging #134
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
base: main
Are you sure you want to change the base?
Conversation
| res.headers_mut().insert( | ||
| actix_web::http::header::HeaderName::from_static("x-request-id"), | ||
| rid.parse().unwrap(), | ||
| HeaderName::from_static("x-req-id"), |
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.
Why is this renamed?
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.
Changed it back to x-request-id
|
@yuvrajjsingh0 why does this need a lot of changes? Making code from parallel to sequential should usually be a lot simpler |
| { | ||
| let n = operations.len(); | ||
| let mut set = JoinSet::new(); | ||
| assert!(n >= 1, "need at least one operation (the final)"); |
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.
Where is this assert handled?
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.
Removed it, added safe if..else to handle these
| App::new() | ||
| .wrap(actix_web::middleware::from_fn(request_id_mw)) | ||
| .wrap(TracingLogger::default()) | ||
| .wrap(TracingLogger::<WithRequestId>::new()) |
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.
Does this PR have other changes, Or is this needed to sequentialise
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.
It has changes for request_id other than sequentialise
568a5e0 to
92a6bee
Compare
Reduce parallelism so that superposition doesn't get into race conditions - if I have N operations to do, I'do N-1 operations concurrently and wait for them to complete, then do the last operation, this way superposition's last config snapshot creation will always have latest data and won't run through race conditions.
[Logging]
Added more contexts in the default span: