Skip to content
Snippets Groups Projects
Commit 2826e0e2 authored by Michael Davis's avatar Michael Davis
Browse files

[EOS-CTA] Adds a sleep before UnBind

There needs to be some proper synchronisation here, as Finished() must
be called before UnBind(). Sleep is a stopgap, I have raised an issue
with Andy.
parent 638504c0
Branches
Tags
No related merge requests found
#ifndef __XRD_SSI_CTA_SERVICE_H
#define __XRD_SSI_CTA_SERVICE_H
#include <unistd.h> // for debugging
#include <XrdSsi/XrdSsiService.hh>
#include "XrdSsiPbRequestProc.h"
......@@ -34,7 +36,9 @@ public:
template <typename RequestType, typename MetadataType, typename AlertType>
void XrdSsiCtaService<RequestType, MetadataType, AlertType>::ProcessRequest(XrdSsiRequest &reqRef, XrdSsiResource &resRef)
{
#ifdef XRDSSI_DEBUG
std::cerr << "Called ProcessRequest()" << std::endl;
#endif
RequestProc<RequestType, MetadataType, AlertType> processor;
......@@ -45,6 +49,18 @@ void XrdSsiCtaService<RequestType, MetadataType, AlertType>::ProcessRequest(XrdS
// Execute the request, upon return the processor is deleted
processor.Execute();
// Tell the framework we are done with the request object
// WE NEED TO ENSURE THAT FINISHED() HAS BEEN CALLED BEFORE UNBIND
sleep(1);
#ifdef XRDSSI_DEBUG
std::cout << "ProcessRequest.UnBind()" << std::endl;
#endif
// Unbind the request from the responder
processor.UnBindRequest();
}
#endif
......@@ -51,8 +51,16 @@ template <typename RequestType, typename MetadataType, typename AlertType>
class RequestProc : public XrdSsiResponder
{
public:
RequestProc() {}
virtual ~RequestProc() {}
RequestProc() {
#ifdef XRDSSI_DEBUG
std::cout << "Called RequestProc() constructor" << std::endl;
#endif
}
virtual ~RequestProc() {
#ifdef XRDSSI_DEBUG
std::cout << "Called ~RequestProc() destructor" << std::endl;
#endif
}
void Execute();
virtual void Finished(XrdSsiRequest &rqstR, const XrdSsiRespInfo &rInfo, bool cancel=false) override;
......@@ -188,16 +196,6 @@ void RequestProc<RequestType, MetadataType, AlertType>::Finished(XrdSsiRequest &
{
// Reclaim any allocated resources
}
// Tell the framework we are done with the request object
#ifdef XRDSSI_DEBUG
std::cout << "ProcessRequest.UnBind()" << std::endl;
#endif
// Unbind the request from the responder
UnBindRequest();
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment