Skip to content

Commit e4a58dd

Browse files
committed
prevent issue report on read_object_md if the object doesn't exist
Signed-off-by: Utkarsh Srivastava <[email protected]> add todo comment to be able to handle GLACIER objects Signed-off-by: Utkarsh Srivastava <[email protected]> (cherry picked from commit ea8d44c)
1 parent 3236984 commit e4a58dd

File tree

2 files changed

+26
-10
lines changed

2 files changed

+26
-10
lines changed

src/sdk/namespace_blob.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,17 @@ class NamespaceBlob {
161161
} catch (err) {
162162
this._translate_error_code(err);
163163
dbg.warn('NamespaceBlob.read_object_md:', inspect(err));
164-
object_sdk.rpc_client.pool.update_issues_report({
165-
namespace_resource_id: this.namespace_resource_id,
166-
error_code: err.code || (err.details && err.details.errorCode) || 'InternalError',
167-
time: Date.now(),
168-
});
164+
165+
// It's totally expected to issue `HeadObject` against an object that doesn't exist
166+
// this shouldn't be counted as an issue for the namespace store
167+
if (err.rpc_code !== 'NO_SUCH_OBJECT') {
168+
object_sdk.rpc_client.pool.update_issues_report({
169+
namespace_resource_id: this.namespace_resource_id,
170+
error_code: err.code || (err.details && err.details.errorCode) || 'InternalError',
171+
time: Date.now(),
172+
});
173+
}
174+
169175
throw err;
170176
}
171177
}

src/sdk/namespace_s3.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,21 @@ class NamespaceS3 {
207207
} catch (err) {
208208
this._translate_error_code(params, err);
209209
dbg.warn('NamespaceS3.read_object_md:', inspect(err));
210-
object_sdk.rpc_client.pool.update_issues_report({
211-
namespace_resource_id: this.namespace_resource_id,
212-
error_code: String(err.code),
213-
time: Date.now(),
214-
});
210+
211+
// It's totally expected to issue `HeadObject` against an object that doesn't exist
212+
// this shouldn't be counted as an issue for the namespace store
213+
//
214+
// @TODO: Another error to tolerate is 'InvalidObjectState'. This shouldn't also
215+
// result in IO_ERROR for the namespace however that means we can not do `getObject`
216+
// even when `can_use_get_inline` is true.
217+
if (err.rpc_code !== 'NO_SUCH_OBJECT') {
218+
object_sdk.rpc_client.pool.update_issues_report({
219+
namespace_resource_id: this.namespace_resource_id,
220+
error_code: String(err.code),
221+
time: Date.now(),
222+
});
223+
}
224+
215225
throw err;
216226
}
217227
}

0 commit comments

Comments
 (0)