SAM_HC_SEND(3)

πŸ’– SAM_HC_SEND(3) πŸ’–

okay bestie, welcome to the Corosync Cluster Engine Programmer's Manual ✨ this is the sam_hc_send page and it's lowkey one of the most important little calls you'll ever make, no cap.


🌸 NAME 🌸

sam_hc_send β€” send health check confirmation 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <corosync/sam.h>

cs_error_t sam_hc_send (void);

✨ DESCRIPTION ✨

so the sam_hc_send function is literally your app raising its hand and going "i'm alive!! i'm here!!" πŸ’… it's how you send a healthcheck confirmation from the application.

the way that you should call this regularly when you're configured for application driven healthchecking. like, on a schedule. do not ghost it. because if you don't call it, recovery action will be taken 😭 (yes, the dramatic kind).

but β€” and this is the important part, bestie β€” when you're using event driven healthchecking, this function should not be used. different vibe entirely, okay? don't mix them up πŸ™ˆ


πŸ’« RETURN VALUE πŸ’«

this call returns the CS_OK value if it's successful πŸŽ‰ otherwise an error is returned. simple as that.


πŸ’€ ERRORS πŸ’€

  • CS_ERR_BAD_HANDLE β€” health checking is not in running state (meaning sam_start(3) has not been executed) or the function is called after stop/finalization of SAM. it's giving "you showed up to the party after it ended" energy.

πŸ‘‘ SEE ALSO πŸ‘‘

and here's the rest of the error crew, because they live down here too 🫢:

  • CS_ERR_TRY_AGAIN β€” Resource temporarily unavailable
  • CS_ERR_INVALID_PARAM β€” Invalid argument
  • CS_ERR_ACCESS β€” Permission denied
  • CS_ERR_LIBRARY β€” The connection failed
  • CS_ERR_INTERRUPT β€” System call interrupted by a signal
  • CS_ERR_NOT_SUPPORTED β€” The requested protocol/functionality not supported
  • CS_ERR_MESSAGE_ERROR β€” Incorrect auth message received
  • CS_ERR_NO_MEMORY β€” Not enough memory to complete the requested task

ngl, that CS_ERR_BAD_HANDLE one gets everybody at least once. call sam_start(3) first, bestie, i'm begging πŸ™

okay that's the whole page!! this was the corosync Man Page, dated 12/01/2009, and you just read SAM_HC_SEND(3) πŸ’– slay, go keep your app alive, you got this πŸ¦‹βœ¨

πŸ“¦ where this page comes from