MCPcopy Create free account
hub / github.com/apache/cloudberry / SharedFileSetDeleteOnProcExit

Function SharedFileSetDeleteOnProcExit

src/backend/storage/file/sharedfileset.c:266–284  ·  view source on GitHub ↗

* Callback function that will be invoked on the process exit. This will * process the list of all the registered sharedfilesets and delete the * underlying files. */

Source from the content-addressed store, hash-verified

264 * underlying files.
265 */
266static void
267SharedFileSetDeleteOnProcExit(int status, Datum arg)
268{
269 /*
270 * Remove all the pending shared fileset entries. We don't use foreach()
271 * here because SharedFileSetDeleteAll will remove the current element in
272 * filesetlist. Though we have used foreach_delete_current() to remove the
273 * element from filesetlist it could only fix up the state of one of the
274 * loops, see SharedFileSetUnregister.
275 */
276 while (list_length(filesetlist) > 0)
277 {
278 SharedFileSet *fileset = (SharedFileSet *) linitial(filesetlist);
279
280 SharedFileSetDeleteAll(fileset);
281 }
282
283 filesetlist = NIL;
284}
285
286/*
287 * Unregister the shared fileset entry registered for cleanup on proc exit.

Callers

nothing calls this directly

Calls 2

list_lengthFunction · 0.85
SharedFileSetDeleteAllFunction · 0.85

Tested by

no test coverage detected