MCPcopy Create free account
hub / github.com/apple/foundationdb / doClose

Function doClose

fdbserver/KeyValueStoreSQLite.actor.cpp:2066–2094  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2064 }
2065
2066 ACTOR static void doClose(KeyValueStoreSQLite* self, bool deleteOnClose) {
2067 state Error error = success();
2068
2069 self->disableRateControl();
2070
2071 try {
2072 TraceEvent("KVClose", self->logID).detail("Filename", self->filename).detail("Del", deleteOnClose);
2073 self->starting.cancel();
2074 self->cleaning.cancel();
2075 self->logging.cancel();
2076 wait(self->readThreads->stop() && self->writeThread->stop());
2077 if (deleteOnClose) {
2078 wait(IAsyncFileSystem::filesystem()->incrementalDeleteFile(self->filename, true));
2079 wait(IAsyncFileSystem::filesystem()->incrementalDeleteFile(self->filename + "-wal", false));
2080 }
2081 } catch (Error& e) {
2082 TraceEvent(SevError, "KVDoCloseError", self->logID)
2083 .errorUnsuppressed(e)
2084 .detail("Filename", self->filename)
2085 .detail("Reason", e.code() == error_code_platform_error ? "could not delete database" : "unknown");
2086 error = e;
2087 }
2088
2089 TraceEvent("KVClosed", self->logID).detail("Filename", self->filename);
2090 if (error.code() != error_code_actor_cancelled) {
2091 self->stopped.send(Void());
2092 delete self;
2093 }
2094 }
2095};
2096IKeyValueStore* keyValueStoreSQLite(std::string const& filename,
2097 UID logID,

Callers 8

closeMethod · 0.85
closeMethod · 0.85
disposeFunction · 0.85
closeFunction · 0.85
disposeMethod · 0.85
closeMethod · 0.85
disposeMethod · 0.85
closeMethod · 0.85

Calls 8

TraceEventClass · 0.85
detailMethod · 0.80
incrementalDeleteFileMethod · 0.80
cancelMethod · 0.65
VoidClass · 0.50
stopMethod · 0.45
codeMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected