-
Notifications
You must be signed in to change notification settings - Fork 95
Fix the issue that client without protocol version set cannot talk to server with protocol version check. #1106
Conversation
… server with protocol version check.
esx_service/vmdk_ops.py
Outdated
@@ -1491,8 +1491,8 @@ def execRequestThread(client_socket, cartel, request): | |||
send_vmci_reply(client_socket, reply_string) | |||
else: | |||
logging.debug("execRequestThread: req=%s", req) | |||
# If req from client does not include version number, set the version to "1" by default | |||
client_protocol_version = int(req["version"]) if "version" in req else 1 | |||
# If req from client does not include version number, set the version to "2" by default |
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.
"2" seems a magic number here. Shouldn't we just use the constant "SERVER_PROTOCOL_VERSION"?
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.
sure.
I have test the following two configuration manually with basic create/attach/detach/rm flow. Docker version in Ubuntu VM: Config1: ESX with latest build (0.12.938dc3e-0.0.1, with protocol version check), VM install 0.12 build (0.12.dadf7db, without protocol version set) step1: create volume
step2: run a busybox container to attach the volume
step3: remove the container to detach the volume
step4: remove volume
Config2: ESX with 0.12 build (0.12.3f64805-0.0.1, no protocol version check), VM with latest build (0.12.938dc3e, with protocol version set) step1: create volume
step2: run a busybox container to attach the volume
step3: remove the container to detach the volume
step4: remove volume
|
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.
LGTM!
@lipingxue can you please link the issue this PR is fixing? |
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.
LGTM.
client_protocol_version = int(req["version"]) if "version" in req else 1 | ||
# If req from client does not include version number, set the version to | ||
# SERVER_PROTOCOL_VERSION by default to make backward compatible | ||
client_protocol_version = int(req["version"]) if "version" in req else SERVER_PROTOCOL_VERSION |
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.
I see. Looks like original implementation did consider backward compatibility but hardcoded version, 1, broke it!
1dcdfa1
to
e4b7775
Compare
This PR is to make sure client without protocol version set can talk to server with protocol check
to make sure the backward compatibility.
Fixed #1102.