CPG_FINALIZE(3)

πŸ’– CPG_FINALIZE(3) πŸ’–

okay bestie, gather round 🫢 this one lives in the Corosync Cluster Engine Programmer's Manual, section 3, and it's genuinely one of the shortest little icons in the whole CPG family. lowkey a palate cleanser. let's get into it ✨


🌸 NAME 🌸

cpg_finalize β€” terminate a connection to the CPG service πŸ’…

that's it. that's the whole job. she's a goodbye girlie.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <corosync/cpg.h>

int cpg_finalize(cpg_handle_t handle);

like, copy that exactly, bestie, don't freestyle it πŸ™ˆ


✨ DESCRIPTION ✨

so the cpg_finalize function is the one you call to close a connection to the closed process group API. it's the breakup text. it's the "we need to talk" but make it clean and mutual πŸ’”

once the connection is finalized, the handle may not be used again by applications. β€” not "shouldn't", not "preferably not", may not. that handle is done. retired. she's moved to a different city and changed her number. if you keep passing it around, that's on you, and it will not go well πŸ’€

also, and this is the part people forget: no more callbacks will be dispatched from the cpg_dispatch function. zero. none. the group chat is muted, archived, and you've left it. so don't sit there calling cpg_dispatch waiting for a callback that is never, ever coming, because that's giving "texting your ex at 3am" energy and it's not the move 😭


πŸ‘‘ RETURN VALUE πŸ‘‘

  • this call returns the CS_OK value if it worked ✨
  • otherwise, an error is returned 😬

πŸ’€ ERRORS πŸ’€

the errors are undocumented. yeah. i know. i'm as upset as you are. no cap, there is literally nothing else here. πŸ™ˆ

🌈 SEE ALSO 🌈

the whole CPG cinematic universe, fr fr:

and then β€” and yes, these really are just hanging out at the bottom of SEE ALSO in the original, i'm not making this up πŸŽ€ β€” the error codes, listed with their little one-liners:

  • 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

tiny vibe check before you go: if you're looking for the actual list of errors cpg_finalize can throw, the ERRORS section up there said undocumented, so this list is just what's printed in the SEE ALSO block of the page. don't come for me, i'm only the messenger 🫢

and that's the whole page, bestie!! πŸ’– stay safe out there, finalize your handles, and never touch a dead one again. main character energy only πŸ‘‘

this page comes to you from the corosync Man Page, dated 2004-08-31, and yes she's an old queen but she still slays ✨ mwah πŸ’…

πŸ“¦ where this page comes from