Uh oh!
There was an error while loading. Please reload this page.
[EXP] ARROW-4036: [C++] Pluggable status codes - #3199
Conversation
This approach uses static registration.
| ASSERT_TRUE(res.IsInvalid()); | ||
| } | ||
| static const char* test_messages1[] = {"First error", "Second error"}; |
| // a `State` structure containing the error code and message(s) | ||
| State* state_; | ||
| static std::unordered_map<uint64_t, const StatusRange*> ranges_; |
There was a problem hiding this comment.
Seems like we're needing more and more a global arrow::init().
There was a problem hiding this comment.
Are you afraid of the static initialization here?
There was a problem hiding this comment.
Yes, seems likely that we'll need more and more controlled static initialization:
- Utf8 utils make use of call_once
- This patch (which other static initializers might depend in proper order, but controllable since we're referencing with int32/int64)
- Gandiva make use of call_once, I think this one can be tricky due to possible failures and the time it takes to init, e.g. it's friendlier to the user if he has visibility (time take, failure, ...)
emkornfield
commented
May 29, 2019
@pitrou@fsaintjacques what is the status of this? |
pitrou
commented
May 29, 2019
@emkornfield It's completely stale, and noone is actively working on it. I still think it's a good idea, though, because we have more and more subsystems (Python, R, Flight, etc.). One useful extension of this would be to have optional arbitrary data embedded in the error state, for example if an error comes from a Python exception, it would be useful to record the original Python exception - especially if the Status is converted back into a Python error, so that the traceback doesn't get lost. |
wesm
commented
May 29, 2019
@pitrou@emkornfield I agree that it's a good idea, as long as it doesn't cause any performance issues. I see this introduces unordered_map into the includes which may want to be avoided based on recent patches =) |
emkornfield
commented
May 30, 2019
@wesm@pitrou I agree it could be useful I guess I was asking what the blockers are? Should we close this PR and formulate a new one? @pitrou you mentioned prioritization on an ML thread, if you would like me to take this on, I can put it on my backlog (no performance regression might be challenging). Is there a clear list of requirements. |
pitrou
commented
May 30, 2019
@emkornfield There are no blockers per se. There are several constraints:
So this is a study in C++ API design. |
emkornfield
commented
Jun 4, 2019
Is full pluggabiity necessary? I think it would be good to keep the types of errors limited. Would a status that has the following traits suffice?
|
pitrou
commented
Jun 4, 2019
If you have something precise in mind, perhaps best is to try and sketch an implementation, and post another PR? |
emkornfield
commented
Jun 6, 2019
emkornfield
commented
Jun 27, 2019
pitrou
commented
Jun 27, 2019
No, this can be closed. |
This approach uses static registration. I recommend comparing with other approaches.