Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ServiceBus] Small set of non-blocking changes from b6. #13690

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class BaseSession(object):
def __init__(self, session_id, receiver, encoding="UTF-8"):
# type: (str, Union[ServiceBusSessionReceiver, ServiceBusSessionReceiverAsync], str) -> None
self._id = session_id
self._session_id = session_id
self._receiver = receiver
self._encoding = encoding
self._session_start = None
Expand Down Expand Up @@ -58,7 +58,7 @@ def session_id(self):

:rtype: str
"""
return self._id
return self._session_id

@property
def locked_until_utc(self):
Expand Down Expand Up @@ -110,7 +110,7 @@ def get_state(self):
self._check_live()
response = self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
REQUEST_RESPONSE_GET_SESSION_STATE_OPERATION,
{MGMT_REQUEST_SESSION_ID: self._id},
{MGMT_REQUEST_SESSION_ID: self._session_id},
mgmt_handlers.default
)
session_state = response.get(MGMT_RESPONSE_SESSION_STATE)
Expand Down Expand Up @@ -138,7 +138,7 @@ def set_state(self, state):
state = state.encode(self._encoding) if isinstance(state, six.text_type) else state
return self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
{MGMT_REQUEST_SESSION_ID: self._id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
{MGMT_REQUEST_SESSION_ID: self._session_id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
mgmt_handlers.default
)

Expand Down Expand Up @@ -169,7 +169,7 @@ def renew_lock(self):
self._check_live()
expiry = self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
REQUEST_RESPONSE_RENEW_SESSION_LOCK_OPERATION,
{MGMT_REQUEST_SESSION_ID: self._id},
{MGMT_REQUEST_SESSION_ID: self._session_id},
mgmt_handlers.default
)
expiry_timestamp = expiry[MGMT_RESPONSE_RECEIVER_EXPIRATION]/1000.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def get_state(self):
self._check_live()
response = await self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
REQUEST_RESPONSE_GET_SESSION_STATE_OPERATION,
{MGMT_REQUEST_SESSION_ID: self._id},
{MGMT_REQUEST_SESSION_ID: self._session_id},
mgmt_handlers.default
)
session_state = response.get(MGMT_RESPONSE_SESSION_STATE)
Expand Down Expand Up @@ -89,7 +89,7 @@ async def set_state(self, state):
state = state.encode(self._encoding) if isinstance(state, six.text_type) else state
return await self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
REQUEST_RESPONSE_SET_SESSION_STATE_OPERATION,
{MGMT_REQUEST_SESSION_ID: self._id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
{MGMT_REQUEST_SESSION_ID: self._session_id, MGMT_REQUEST_SESSION_STATE: bytearray(state)},
mgmt_handlers.default
)

Expand Down Expand Up @@ -120,7 +120,7 @@ async def renew_lock(self):
self._check_live()
expiry = await self._receiver._mgmt_request_response_with_retry( # pylint: disable=protected-access
REQUEST_RESPONSE_RENEW_SESSION_LOCK_OPERATION,
{MGMT_REQUEST_SESSION_ID: self._id},
{MGMT_REQUEST_SESSION_ID: self._session_id},
mgmt_handlers.default
)
expiry_timestamp = expiry[MGMT_RESPONSE_RECEIVER_EXPIRATION]/1000.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class ServiceBusAdministrationClient: #pylint:disable=too-many-public-methods

def __init__(
self, fully_qualified_namespace: str,
credential: Union["AsyncTokenCredential"],
credential: "AsyncTokenCredential",
**kwargs) -> None:

self.fully_qualified_namespace = fully_qualified_namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ async def test_async_mgmt_namespace_get_properties(self, servicebus_namespace_co
assert properties
assert properties.messaging_sku == 'Standard'
# assert properties.name == servicebus_namespace.name
# This is disabled pending investigation of why it isn't getting scrubbed despite expected scrubber use.
# This is disabled pending investigation of why it isn't getting scrubbed despite expected scrubber use.