Skip to content

Commit adac067

Browse files
authored
[Eventhub] Fix conflicting link properties (Azure#29101)
* Store remote properties * Revert error change for now
1 parent 8b2bbac commit adac067

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/_connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ def __init__(self, endpoint, **kwargs): # pylint:disable=too-many-statements
139139
self._offered_capabilities = None # type: Optional[str]
140140
self._desired_capabilities = kwargs.pop("desired_capabilities", None) # type: Optional[str]
141141
self._properties = kwargs.pop("properties", None) # type: Optional[Dict[str, str]]
142+
self._remote_properties = None # type: Optional[Dict[str, str]]
142143

143144
self._allow_pipelined_open = kwargs.pop("allow_pipelined_open", True) # type: bool
144145
self._remote_idle_timeout = None # type: Optional[int]
@@ -416,6 +417,7 @@ def _incoming_open(self, channel, frame):
416417
)
417418
return
418419
self._remote_max_frame_size = frame[2]
420+
self._remote_properties = frame[9]
419421
if self.state == ConnectionState.OPEN_SENT:
420422
self._set_state(ConnectionState.OPENED)
421423
elif self.state == ConnectionState.HDR_EXCH:

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_connection_async.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ def __init__(self, endpoint, **kwargs): # pylint:disable=too-many-statements
134134
self._properties = kwargs.pop(
135135
"properties", None
136136
) # type: Optional[Dict[str, str]]
137+
self._remote_properties = None # type: Optional[Dict[str, str]]
137138

138139
self._allow_pipelined_open = kwargs.pop(
139140
"allow_pipelined_open", True
@@ -430,6 +431,7 @@ async def _incoming_open(self, channel, frame):
430431
)
431432
return
432433
self._remote_max_frame_size = frame[2]
434+
self._remote_properties = frame[9]
433435
if self.state == ConnectionState.OPEN_SENT:
434436
await self._set_state(ConnectionState.OPENED)
435437
elif self.state == ConnectionState.HDR_EXCH:

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_link_async.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def __init__(self, session, handle, name, role, **kwargs):
7878
self.remote_max_message_size = None
7979
self.available = kwargs.pop("available", None)
8080
self.properties = kwargs.pop("properties", None)
81+
self.remote_properties = None
8182
self.offered_capabilities = None
8283
self.desired_capabilities = kwargs.pop("desired_capabilities", None)
8384

@@ -173,10 +174,8 @@ async def _incoming_attach(self, frame):
173174
self.remote_handle = frame[1] # handle
174175
self.remote_max_message_size = frame[10] # max_message_size
175176
self.offered_capabilities = frame[11] # offered_capabilities
176-
if self.properties:
177-
self.properties.update(frame[13]) # properties
178-
else:
179-
self.properties = frame[13]
177+
self.remote_properties = frame[13]
178+
180179
if self.state == LinkState.DETACHED:
181180
await self._set_state(LinkState.ATTACH_RCVD)
182181
elif self.state == LinkState.ATTACH_SENT:

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/aio/_session_async.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def __init__(self, connection, channel, **kwargs):
4545
self.state = SessionState.UNMAPPED
4646
self.handle_max = kwargs.get("handle_max", 4294967295)
4747
self.properties = kwargs.pop("properties", None)
48+
self.remote_properties = None
4849
self.channel = channel
4950
self.remote_channel = None
5051
self.next_outgoing_id = kwargs.pop("next_outgoing_id", 0)
@@ -137,6 +138,7 @@ async def _incoming_begin(self, frame):
137138
self.next_incoming_id = frame[1] # next_outgoing_id
138139
self.remote_incoming_window = frame[2] # incoming_window
139140
self.remote_outgoing_window = frame[3] # outgoing_window
141+
self.remote_properties = frame[7] # properties
140142
if self.state == SessionState.BEGIN_SENT:
141143
self.remote_channel = frame[0] # remote_channel
142144
await self._set_state(SessionState.MAPPED)

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/link.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def __init__(self, session, handle, name, role, **kwargs):
7676
self.remote_max_message_size = None
7777
self.available = kwargs.pop("available", None)
7878
self.properties = kwargs.pop("properties", None)
79+
self.remote_properties = None
7980
self.offered_capabilities = None
8081
self.desired_capabilities = kwargs.pop("desired_capabilities", None)
8182

@@ -172,10 +173,8 @@ def _incoming_attach(self, frame):
172173
self.remote_handle = frame[1] # handle
173174
self.remote_max_message_size = frame[10] # max_message_size
174175
self.offered_capabilities = frame[11] # offered_capabilities
175-
if self.properties:
176-
self.properties.update(frame[13]) # properties
177-
else:
178-
self.properties = frame[13]
176+
self.remote_properties = frame[13] # properties
177+
179178
if self.state == LinkState.DETACHED:
180179
self._set_state(LinkState.ATTACH_RCVD)
181180
elif self.state == LinkState.ATTACH_SENT:

sdk/eventhub/azure-eventhub/azure/eventhub/_pyamqp/session.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def __init__(self, connection, channel, **kwargs):
4444
self.state = SessionState.UNMAPPED
4545
self.handle_max = kwargs.get("handle_max", 4294967295)
4646
self.properties = kwargs.pop("properties", None)
47+
self.remote_properties = None
4748
self.channel = channel
4849
self.remote_channel = None
4950
self.next_outgoing_id = kwargs.pop("next_outgoing_id", 0)
@@ -150,6 +151,7 @@ def _incoming_begin(self, frame):
150151
self.next_incoming_id = frame[1] # next_outgoing_id
151152
self.remote_incoming_window = frame[2] # incoming_window
152153
self.remote_outgoing_window = frame[3] # outgoing_window
154+
self.remote_properties = frame[7] # properties
153155
if self.state == SessionState.BEGIN_SENT:
154156
self.remote_channel = frame[0] # remote_channel
155157
self._set_state(SessionState.MAPPED)

0 commit comments

Comments
 (0)