Skip to content

Commit d011a0b

Browse files
authored
Merge branch 'apache:main' into wip_opfs_3
2 parents ef24c81 + ec16a1e commit d011a0b

File tree

16 files changed

+595
-386
lines changed

16 files changed

+595
-386
lines changed

core/Cargo.lock

Lines changed: 47 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ logforth = { version = "0.29.1", features = ["starter-log"] }
5151
mea = "0.6"
5252
quick-xml = { version = "0.38", default-features = false }
5353
rand = "0.8"
54-
reqsign = { version = "0.16.5", default-features = false }
5554
serde = { version = "1", default-features = false }
5655
serde_json = "1"
5756
sha2 = "0.10"

core/core/src/raw/oio/list/flat_list.rs

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,31 @@ where
103103
);
104104
continue;
105105
}
106+
Err(e) if e.kind() == ErrorKind::NotFound => {
107+
// Skip directories that are deleted while listing.
108+
log::warn!(
109+
"FlatLister skipping directory due to not found during listing: {}",
110+
de.path()
111+
);
112+
continue;
113+
}
106114
Err(e) => return Err(e),
107115
};
108-
if let Some(v) = l.next().await? {
116+
let first = loop {
117+
match l.next().await {
118+
Ok(v) => break v,
119+
Err(e) if e.kind() == ErrorKind::NotFound => {
120+
// Skip entries that are deleted during listing.
121+
log::warn!(
122+
"FlatLister skipping entry due to not found during listing: {}",
123+
de.path()
124+
);
125+
continue;
126+
}
127+
Err(e) => return Err(e),
128+
}
129+
};
130+
if let Some(v) = first {
109131
self.active_lister.push((Some(de.clone()), l));
110132

111133
if v.mode().is_dir() {
@@ -120,21 +142,40 @@ where
120142
}
121143
}
122144

145+
if matches!(self.active_lister.last(), Some((None, _))) {
146+
let _ = self.active_lister.pop();
147+
continue;
148+
}
149+
123150
let (de, lister) = match self.active_lister.last_mut() {
124151
Some((de, lister)) => (de, lister),
125152
None => return Ok(None),
126153
};
127154

128-
match lister.next().await? {
129-
Some(v) if v.mode().is_dir() => {
155+
match lister.next().await {
156+
Err(e) if e.kind() == ErrorKind::NotFound => {
157+
let path = de.as_ref().map(|entry| entry.path()).unwrap_or("<unknown>");
158+
log::warn!(
159+
"FlatLister skipping entry due to not found during recursive listing: {}",
160+
path
161+
);
162+
continue;
163+
}
164+
Err(e) => return Err(e),
165+
Ok(Some(v)) if v.mode().is_dir() => {
130166
// should not loop itself again
131-
if v.path() != de.as_ref().expect("de should not be none here").path() {
167+
if v.path()
168+
!= de
169+
.as_ref()
170+
.expect("de must be present before listing")
171+
.path()
172+
{
132173
self.next_dir = Some(v);
133174
continue;
134175
}
135176
}
136-
Some(v) => return Ok(Some(v)),
137-
None => match de.take() {
177+
Ok(Some(v)) => return Ok(Some(v)),
178+
Ok(None) => match de.take() {
138179
Some(de) => {
139180
return Ok(Some(de));
140181
}

core/layers/fastmetrics/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ version = { workspace = true }
3131
all-features = true
3232

3333
[dependencies]
34-
fastmetrics = "0.6"
34+
fastmetrics = "0.7"
3535
opendal-core = { path = "../../core", version = "0.55.0", default-features = false }
3636
opendal-layer-observe-metrics-common = { path = "../observe-metrics-common", version = "0.55.0", default-features = false }
3737

0 commit comments

Comments
 (0)