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

[RSDK-9213] restart on fd error #351

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions micro-rdk/src/common/app_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ impl AppClientError {
}
false
}
// TODO(RSDK-9276)
pub fn is_fs_error(&self) -> bool {
if let AppClientError::AppGrpcClientError(GrpcClientError::GrpcError { code, message }) = self {
if *code == 23 && message.contains("many open files") {
return true;
}
}
false
}
}

pub struct AppClientBuilder {
Expand Down
3 changes: 3 additions & 0 deletions micro-rdk/src/common/conn/viam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ where
});
#[cfg(not(test))]
panic!("erased credentials restart robot"); // TODO bubble up error and go back in provisioning
} else if error.is_fs_error() {
log::error!("no available file descriptors, restarting");
esp_idf_svc::hal::reset::restart();
}
log::error!("couldn't connect to signaling server, reason {:?}", error);
})
Expand Down
Loading