Skip to content

Commit

Permalink
apiserver: don't fail list_transactions if '/pending' doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
tjkirch committed Feb 21, 2020
1 parent 752d497 commit cac0bc9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion workspaces/api/apiserver/src/datastore/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,19 @@ impl DataStore for FilesystemDataStore {
);

for entry in walker {
let entry = entry.context(error::ListKeys)?;
let entry = match entry {
Ok(entry) => entry,
Err(e) => {
if let Some(io_error) = e.io_error() {
// If there's no pending directory, that's OK, just return empty set.
if io_error.kind() == io::ErrorKind::NotFound {
break;
}
}
return Err(e).context(error::ListKeys);
}
};

if entry.file_type().is_dir() {
// The directory name should be valid UTF-8, encoded by encode_path_component,
// or the data store has been corrupted.
Expand Down

0 comments on commit cac0bc9

Please sign in to comment.