Skip to content
Snippets Groups Projects
Commit 5a484da1 authored by Eric Cano's avatar Eric Cano
Browse files

cta/CTA#46: Adding garbage collection for object store structures:

Added missing destructor for GCHandler.
Added subprocess to taped's process manager.
parent 8738ed8e
No related branches found
No related tags found
No related merge requests found
......@@ -320,7 +320,17 @@ SubprocessHandler::ProcessingStatus GarbageCollectorHandler::shutdown() {
return m_processingStatus;
}
//------------------------------------------------------------------------------
// GarbageCollectorHandler::runChild
//------------------------------------------------------------------------------
GarbageCollectorHandler::~GarbageCollectorHandler() {
// If we still have a child process (should not), just stop it the hard way.
if (-1 != m_pid) {
cta::log::ScopedParamContainer params(m_processManager.logContext());
params.add("pid", m_pid);
::kill(m_pid, SIGKILL);
m_processManager.logContext().log(log::WARNING, "In GarbageCollectorHandler::~GarbageCollectorHandler(): killed leftover subprocess");
}
}
}}} // namespace cta::tape::daemon
\ No newline at end of file
......@@ -23,6 +23,7 @@
#include "ProcessManager.hpp"
#include "SignalHandler.hpp"
#include "DriveHandler.hpp"
#include "GarbageCollectorHandler.hpp"
#include <google/protobuf/service.h>
#include <limits.h>
......@@ -106,7 +107,9 @@ void cta::tape::daemon::TapeDaemon::mainEventLoop() {
std::unique_ptr<DriveHandler> dh(new DriveHandler(m_globalConfiguration, d.second.value(), pm));
pm.addHandler(std::move(dh));
}
// TODO: add the garbage collector once implemented
// Create the garbage collector
std::unique_ptr<GarbageCollectorHandler> gc(new GarbageCollectorHandler(m_globalConfiguration, pm));
pm.addHandler(std::move(gc));
// And run the process manager
int ret=pm.run();
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment