You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FileSystem define the following interface, which can't handle temporary runtime errors properly but just swallow them (like GCS, HDFS and any customized DFS),
virtualboolFileExists(const string& fname) = 0;
It should be changed to
virtual Status FileExists(const string& fname) = 0;
I can provide a patch if no one is working on this.
This is more friendly (less error handling code) for the caller to handle unexpected errors:
virtual Status FileExists(const string& fname, bool* result) = 0;
And IsDirectory should also be changed to (both for API semantics consistency and making the caller easier to handle the runtime error, most of the current caller code just ignored them):
virtual Status IsDirectory(const string& fname, bool* result) = 0;
May be this can be addresses by another change.
I'm creating a patch for FileExists first.
Activity
aselle commentedon Nov 1, 2016
@jhseu, I'm marking this contributions welcome, assuming you agree with that change.
jhseu commentedon Nov 1, 2016
Yeah, I agree that's an issue. I can make the change, though, because we also have to change the implementation for our internal filesystem.
llhe commentedon Nov 2, 2016
This is more friendly (less error handling code) for the caller to handle unexpected errors:
And IsDirectory should also be changed to (both for API semantics consistency and making the caller easier to handle the runtime error, most of the current caller code just ignored them):
May be this can be addresses by another change.
I'm creating a patch for FileExists first.
jhseu commentedon Nov 4, 2016
Fixed internally. It'll show up during the next sync.
As mentioned in your pull request, we decided on:
for consistency with how we've been using these error codes elsewhere.