Commit 2c8cc73
committed
remote/common: add monkey patch function for maxMessagePayloadSize in WampWebSocketClientFactory.setProtocolOptions
Larger labgrid remote infrastructure setups with a big number of
exported resources are limited by the maximum WebSocket payload size of
1M in autobahn [1]: When calling `get_resources()` in this situation,
labgrid-client simply hangs. In crossbar's log errors occur:
tried to send WebSocket message with size 1068476 exceeding payload limit of 1048576 octets
There is no easy way of setting this WebSocket option, since it's set in
`ApplicationRunner.run()` [2], which would need to be duplicated into
labgrid's source code in its entirety. For an upstream approach, see [3]
which was reverted without comment in [4].
So increase the maximum payload size from 1M to 10M by monkey patching
maxMessagePayloadSize in WampWebSocketClientFactory.setProtocolOptions().
In oder to be able to actually send these payload sizes, a previous patch
already enabled auto fragmentation of outgoing WebSocket messages into
multiple WebSocket frames in crossbar's configuration.
[1] https://github.com/crossbario/autobahn-python/blob/359f868f9db410586cf01c071220994d8d7f165a/autobahn/asyncio/wamp.py#L223
[2] https://github.com/crossbario/autobahn-python/blob/359f868f9db410586cf01c071220994d8d7f165a/autobahn/asyncio/wamp.py#L90
[3] crossbario/autobahn-python#912
[4] crossbario/autobahn-python#921
Signed-off-by: Bastian Krause <bst@pengutronix.de>1 parent a6d1a74 commit 2c8cc73
2 files changed
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
0 commit comments