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

Notify banned solvers #3262

Open
wants to merge 22 commits into
base: blacklist-failing-solvers
Choose a base branch
from

Conversation

squadgazzz
Copy link
Contributor

This is a follow-up to #3257, which was requested in #3257 (comment). Implements solver notification mechanism in case the driver is banned. Reroutes the notification request to the solver through the internal driver. External solvers need to be communicated about this change.

Copy link

github-actions bot commented Jan 30, 2025

Reminder: Please consider backward compatibility when modifying the API specification.
If breaking changes are unavoidable, ensure:

  • You explicitly pointed out breaking changes.
  • You communicate the changes to affected teams (at least Frontend team and SAFE team).
  • You provide proper versioning and migration mechanisms.

Caused by:

@squadgazzz squadgazzz marked this pull request as ready for review January 30, 2025 20:24
@squadgazzz squadgazzz requested a review from a team as a code owner January 30, 2025 20:24
@squadgazzz squadgazzz marked this pull request as draft January 31, 2025 08:43
@squadgazzz squadgazzz marked this pull request as ready for review January 31, 2025 08:52
@squadgazzz squadgazzz force-pushed the notify-banned-solvers branch from 640f68f to 43e650f Compare January 31, 2025 17:39
tokio::task::spawn(future.in_current_span());
}

pub async fn notify(
Copy link
Contributor

Choose a reason for hiding this comment

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

why two functions with the same name but one public and the other private? is the public one really needed? 🤔

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, it is needed. The public one is used in the API router. notify_and_forget is used in many other places. The private notify_ is used to define the common code, which is used in both the public notify and notify_and_forget functions. This avoids the code duplication. Not sure why it is not clear from the code. Would be happy to receive suggestions to improve this.

#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Unable to notify solver")]
UnableToNotify,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it is worth to add some context information like solver address or name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The caller knows for which solver the request was sent. IMO, it is a redundant info here.

crates/driver/src/infra/api/routes/notify/mod.rs Outdated Show resolved Hide resolved
}

#[derive(Debug, thiserror::Error)]
pub enum Error {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Personally I would be ok with omitting completely the error case for notify endpoint (be consistent with how the driver propagates it to solvers) as we always considered this endpoint not too important for system to work and we were not interested to act on failure of notification.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since in another PR there will be another reason, wouldn't the solver be interested in what exactly did we detect?

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.

4 participants