Skip to content

Commit ea8d44c

Browse files
committed
prevent issue report on read_object_md if the object doesn't exist
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com> add todo comment to be able to handle GLACIER objects Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
1 parent 570f843 commit ea8d44c

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
@@ -170,11 +170,17 @@ class NamespaceBlob {
170170
} catch (err) {
171171
this._translate_error_code(err);
172172
dbg.warn('NamespaceBlob.read_object_md:', inspect(err));
173-
object_sdk.rpc_client.pool.update_issues_report({
174-
namespace_resource_id: this.namespace_resource_id,
175-
error_code: err.code || (err.details && err.details.errorCode) || 'InternalError',
176-
time: Date.now(),
177-
});
173+
174+
// It's totally expected to issue `HeadObject` against an object that doesn't exist
175+
// this shouldn't be counted as an issue for the namespace store
176+
if (err.rpc_code !== 'NO_SUCH_OBJECT') {
177+
object_sdk.rpc_client.pool.update_issues_report({
178+
namespace_resource_id: this.namespace_resource_id,
179+
error_code: err.code || (err.details && err.details.errorCode) || 'InternalError',
180+
time: Date.now(),
181+
});
182+
}
183+
178184
throw err;
179185
}
180186
}

src/sdk/namespace_s3.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,21 @@ class NamespaceS3 {
217217
} catch (err) {
218218
this._translate_error_code(params, err);
219219
dbg.warn('NamespaceS3.read_object_md:', inspect(err));
220-
object_sdk.rpc_client.pool.update_issues_report({
221-
namespace_resource_id: this.namespace_resource_id,
222-
error_code: String(err.code),
223-
time: Date.now(),
224-
});
220+
221+
// It's totally expected to issue `HeadObject` against an object that doesn't exist
222+
// this shouldn't be counted as an issue for the namespace store
223+
//
224+
// @TODO: Another error to tolerate is 'InvalidObjectState'. This shouldn't also
225+
// result in IO_ERROR for the namespace however that means we can not do `getObject`
226+
// even when `can_use_get_inline` is true.
227+
if (err.rpc_code !== 'NO_SUCH_OBJECT') {
228+
object_sdk.rpc_client.pool.update_issues_report({
229+
namespace_resource_id: this.namespace_resource_id,
230+
error_code: String(err.code),
231+
time: Date.now(),
232+
});
233+
}
234+
225235
throw err;
226236
}
227237
}

0 commit comments

Comments
 (0)