Fix bug in heartbeat.
authorTatsuo Ishii <ishii@postgresql.org>
Mon, 10 Feb 2025 09:24:49 +0000 (18:24 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Mon, 10 Feb 2025 09:24:49 +0000 (18:24 +0900)
commitfd3965a177b960f337304f9b8b0ef1e610bc7d08
tree6236abaf7b07439ab8504de433dd278861ce3202
parentb9b8a2d31f284f96bb38ee36cb3a1609d9695d8a
Fix bug in heartbeat.

Following error message was recorded every wd_heartbeat_deadtime since
65dbbe7a0 was committed.

2025-02-10 10:50:37.990: heart_beat_receiver pid 1060625: ERROR:  failed to get socket data from heartbeat receive socket list
2025-02-10 10:50:37.990: heart_beat_receiver pid 1060625: DETAIL:  select() got timeout, exceed 30 sec(s)

The heartbeat receiver waits for heartbeart packet arrives in
select(2) until wd_heartbeat_deadtime is expired. I believe the logic
is wrong: it should wait forever until the packet arrives. In v4.5 or
earlier, the hearbeart receiver waits in recvfrom() without
timeout. So give NULL to select's timeout parameter so that it waits
forever.  Since 65dbbe7a0 is only in master branch, no backpatch is
made.

Reported by: Peng Bo
src/watchdog/wd_heartbeat.c