Commit 848ed89
authored
fix(network): fix heartbeat failure caused by inability to obtain peer address when receiving UDP data (#2364)
Fix #2363.
The root cause is that when starting onebox with `--use_product_config`, both replica
servers and meta servers use [src/server/config.ini](https://github.com/apache/incubator-pegasus/blob/a9a11da886bd32d170fc166c08b69210d89d6a52/src/server/config.ini)
instead of [src/server/config.min.ini](https://github.com/apache/incubator-pegasus/blob/a9a11da886bd32d170fc166c08b69210d89d6a52/src/server/config.min.ini).
As a result, beacons are sent and received over **UDP** instead of **TCP**.
The UDP implementation uses Boost.Asio APIs. If the sender socket does not call `connect()`,
then calling `remote_endpoint()` on the receiver socket will always fail.
The fix is to remove the logic that calls `remote_endpoint()` on the receiving side. This logic
was introduced in #1658 to handle cross-network
scenarios (when the address in the message header differs from the actual socket connection
address, the non-forwarding path corrects it to a recognizable address). Since UDP is primarily used
for the heartbeat scenario, and `beacon_msg` already contains `from_node` and `hp_from_node`,
this logic can be removed.1 parent 817a18d commit 848ed89
1 file changed
+0
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | 351 | | |
365 | 352 | | |
366 | 353 | | |
| |||
384 | 371 | | |
385 | 372 | | |
386 | 373 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | 374 | | |
405 | 375 | | |
406 | 376 | | |
| |||
0 commit comments