CPG_LEAVE(3)

πŸ’– CPG_LEAVE(3) πŸ’–

okay bestie, welcome to the Corosync Cluster Engine Programmer's Manual ✨ this one's a lil three-parter from the CPG library and it's literally the "goodbye, i'm out" button πŸšͺπŸ’¨


🌸 NAME 🌸

cpg_leave β€” Leave a group in the CPG library 🫢


✨ SYNOPSIS ✨

#include <corosync/cpg.h>

int cpg_leave(cpg_handle_t handle, struct cpg_name *group);

πŸ¦‹ DESCRIPTION πŸ¦‹

so, the cpg_leave function is what you call when you wanna leave a group. that's the whole vibe. once a group has been left, the process will no longer receive messages or notifications about events in that group. bye bye group chat 🫑

⚠️ but hold on β€” pay attention bestie, this is the part that gets people. a process is only deemed to have left the group once it has been notified (by its confchg callback) that it has left. so expect to receive at least one confchg callback after calling this function. that's not a bug, that's just the handshake πŸ’… don't be out here thinking you're gone before the callback says you're gone.

the argument group is what you use to specify the group to leave. it is currently ignored though, because only one group can be joined per handle. it's literally just sitting there in the signature to allow for future development πŸ‘‘ (iconic of them, honestly)


πŸŽ€ RETURN VALUE πŸŽ€

this call returns the CS_OK value if it worked, otherwise an error gets returned. no in-between, no grey area πŸ’€


πŸ’œ ERRORS πŸ’œ

ngl bestie... the errors are undocumented πŸ™ˆ that's it, that's the section.


🌈 SEE ALSO 🌈

and the error codes, gathered here like a lil friend group ✨

  • 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

okay that's the whole page bestie, go forth and leave your groups responsibly πŸ’…βœ¨

mwah πŸ’– this was the corosync Man Page, dated 2004-08-31, and you've been reading CPG_LEAVE(3) β€” periodt. πŸ‘‘πŸŒΈ

πŸ“¦ where this page comes from