Report errno and proper strings on vSocket communcation failures #435
Conversation
0b3e7d9
to
36c8226
Compare
Fixes #206 * Client code passes errno up and GO code handles it. CGO auto0-returns (return, error) tuple and error info was there all along, we just use it now. * Server code makes sure errno is properly set (and not cleaned up by close() and the likes) , and sets errno when needed. Python code then generates proper messages * removed uneeded custom error codes - it turned out to be throwaway code * a few cosmetic changes - mainly dropped single letter variables since they are hard to maintain
|
||
response = lib.vmci_reply(c, c_char_p(json.dumps(ret))) | ||
errno = get_errno() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we doing with this errno? Should we log it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, I missed this. Added check and log.
Thanks !
LGTM |
@@ -175,6 +172,7 @@ vsock_get_family(void) | |||
} | |||
|
|||
// Create and connect VMCI socket. | |||
// return success (0) or failure (-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: return CONN_SUCCESS (0) or CONN_FAILURE(-1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
8f12d41
to
bfa2543
Compare
LGTM but this code needs another round of clean up. Will see if I can get it done as part of the capabilities change. |
Fixes #206
CGO auto-returns (return_code, error) tuple and error info was there all along, we just use it now.
and sets errno when needed. Python code then generates proper messages
Tested with CI and 'make all'. some error codes tested manually, to make sure the path works:
docker volume ls
when the ESX service is down. Docker says