13#include "XrdNet/XrdNet.hh"
71 std::vector<XrdClientID *>::iterator i;
99 w->RemoveProofServ(
xps);
117 TRACE(
ALL, k <<
" : "<<
w->fHost.c_str()<<
":"<<
w->fPort <<
" act: "<<
w->Active());
143 if (!o || !
w)
return;
164 if (
w)
w->RemoveProofServ(
this);
284 TRACE(
XERR,
"negative ID: protocol error!");
308 if (cid >= (
int)
fClients.capacity())
313 for (;
ic <= cid;
ic++)
335 TRACE(
DBG,
"svrPID: "<<
fSrvPID<<
", pid: "<<pid<<
", session status: "<<
347 std::vector<XrdClientID *>::iterator i;
349 if ((*i) && (*i)->P()) {
350 if ((*i)->P()->Pid() == pid || (*i)->P()->Pid() == -1) {
369 TRACE(
REQ,
spid<<
": slot for client pid: "<<pid<<
" has been reset");
387 std::vector<XrdClientID *>::iterator i;
389 if ((*i) && (*i)->P() && (*i)->P()->Link())
fNClients++;
463 int ic = 0,
ncz = 0, sid = -1;
476 XPDFORM(
m,
"response instance for sid: %d not found", sid);
485 XPDFORM(
m,
"type: %d, message: '%s' notified to %d clients",
type,
msg, nc);
539 int len =
sizeof(kXR_int32);
540 char *buf =
new char[
len];
542 kXR_int32
ifw = (forward) ? (kXR_int32)1 : (kXR_int32)0;
549 msg =
"could not propagate ping to proofsrv";
575 int len =
sizeof(kXR_int32);
576 char *buf =
new char[
len];
583 TRACE(
XERR,
"problems telling proofserv");
600 TRACE(
HDBG,
"length: "<<
len<<
" bytes (cid: "<<cid<<
")");
612 if (!
rs && !(
csid->R())) {
613 XPDFORM(
msg,
"client not connected: csid: %p, cid: %d, fSid: %d",
674 XrdOucString tag,
alias;
681 XPDFORM(buf,
" | %d %s %s %d %d",
id, tag.c_str(),
alias.c_str(), status, nc);
720 XPDPRT(
"WARNING: path exists: unable to delete it:"
790 TRACE(
XERR,
"unable to open / create status path "<<
fn <<
"; errno = "<<
errno);
802 TRACE(
XERR,
"unable to give ownership of the status file "<<
fn <<
" to user; errno = "<<
errno);
828 msg =
"could not propagate resume to proofsrv";
848 XrdOucString *
wrks = (XrdOucString *)s;
851 if (
w->fType ==
'M') {
852 if (
wrks->length() > 0)
wrks->insert(
'&',0);
853 wrks->insert(
w->Export(), 0);
856 if (
wrks->length() > 0)
859 (*wrks) +=
w->Export(k);
861 TRACE(
HDBG, k <<
" : "<<
w->fHost.c_str()<<
":"<<
w->fPort <<
" act: "<<
w->Active());
889 TRACE(
ALL,
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
891 ", # of queries: "<<
fQueries.size());
892 std::list<XrdProofQuery *>::iterator
ii;
896 TRACE(
ALL,
" +++ #"<<i<<
" tag:"<< (*ii)->GetTag()<<
" dset: "<<
897 (*ii)->GetDSName()<<
" size:"<<(*ii)->GetDSSize());
899 TRACE(
ALL,
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
908 if (!tag ||
strlen(tag) <= 0)
return q;
914 std::list<XrdProofQuery *>::iterator
ii;
917 if (!
strcmp(tag,
q->GetTag()))
break;
930 if (!tag ||
strlen(tag) <= 0)
return;
936 std::list<XrdProofQuery *>::iterator
ii;
939 if (!
strcmp(tag,
q->GetTag()))
break;
957 int *
actw = (
int *)s;
959 *
actw +=
w->GetNActiveSessions();
989 int len = 3*
sizeof(kXR_int32);
990 char *buf =
new char[
len];
995 off +=
sizeof(kXR_int32);
999 off +=
sizeof(kXR_int32);
1006 TRACE(
XERR,
"problems sending proofserv");
1032 std::vector<XrdClientID *>::iterator i;
1034 if ((*i) && (*i)->P() && (*i)->P()->Link()) nc++;
1063 if (
emsg.length() > 0) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define TRACE(Flag, Args)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize id
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
static int DecreaseWorkerCounters(const char *, XrdProofWorker *w, void *x)
Decrease active session counters on worker w.
static int CountEffectiveSessions(const char *, XrdProofWorker *w, void *s)
Decrease active session counters on worker w.
static int DumpWorkerCounters(const char *k, XrdProofWorker *w, void *)
Decrease active session counters on worker w.
static int ExportWorkerDescription(const char *k, XrdProofWorker *w, void *s)
Decrease active session counters on worker w.
#define XPD_CLNT_VERSION_OK(p, v)
#define XrdSysMutexHelper
static int ChangeOwn(const char *path, XrdProofUI ui)
Change the ownership of 'path' to the entity described by 'ui'.
static int GetUserInfo(const char *usr, XrdProofUI &ui)
Get information about user 'usr' in a thread safe way.
static int KillProcess(int pid, bool forcekill, XrdProofUI ui, bool changeown)
Kill the process 'pid'.
int BroadcastPriority(int priority)
Broadcast a new group priority value to the worker servers.
int Resume()
Send a resume message to the this session.
XrdOucHash< XrdProofWorker > fWorkers
void SetIdle()
Set status to idle and update the related time stamp.
void ClearWorkers()
Decrease worker counters and clean-up the list.
void AddWorker(const char *o, XrdProofWorker *w)
Add a worker assigned to this session with label 'o'.
void RemoveQuery(const char *tag)
remove query with tag form the list of queries
void DeleteUNIXSock()
Delete the current UNIX socket.
void SetConnection(XrdProofdResponse *r)
int DisconnectTime()
Return the time (in secs) all clients have been disconnected.
std::list< XrdProofQuery * > fQueries
void ExportBuf(XrdOucString &buf)
Fill buf with relevant info about this session.
void SetProtocol(XrdProofdProtocol *p)
XrdProofdProofServ()
Constructor.
XrdClientID * GetClientID(int cid)
Get instance corresponding to cid.
int CreateUNIXSock(XrdSysError *edest)
Create UNIX socket for internal connections.
int SendData(int cid, void *buff, int len)
Send data to client cid.
int VerifyProofServ(bool fw)
Check if the associated proofserv process is alive.
int TerminateProofServ(bool changeown)
Terminate the associated process.
int FreeClientID(int pid)
Free instance corresponding to protocol connecting process 'pid'.
int SendDataN(void *buff, int len)
Send data over the open client links of this session.
int SetAdminPath(const char *a, bool assert, bool setown)
Set the admin path and make sure the file exists.
XrdProofQuery * GetQuery(const char *tag)
Get query with tag form the list of queries.
XrdOucString fUNIXSockPath
void SendClusterInfo(int nsess, int nacti)
Calculate the effective number of users on this session nodes and communicate it to the master togeth...
XrdProofdProtocol * fProtocol
void ExportWorkers(XrdOucString &wrks)
Export the assigned workers in the format understood by proofserv.
int GetNClients(bool check)
Get the number of connected clients.
void DumpQueries()
Export the assigned workers in the format understood by proofserv.
void Reset()
Reset this instance.
~XrdProofdProofServ()
Destructor.
void Broadcast(const char *msg, int type=kXPD_srvmsg)
Broadcast message 'msg' at 'type' to the attached clients.
std::vector< XrdClientID * > fClients
int IdleTime()
Return the time (in secs) the session has been idle.
XrdProofdResponse * fResponse
bool SkipCheck()
Return the value of fSkipCheck and reset it to false.
void RemoveWorker(const char *o)
Release worker assigned to this session with label 'o'.
void SetRunning()
Set status to running and reset the related time stamp.
void SetParent(XrdClientID *cid)
int CheckSession(bool oldvers, bool isrec, int shutopt, int shutdel, bool changeown, int &nc)
Calculate the effective number of users on this session nodes and communicate it to the master togeth...
int Send(void)
Auxilliary Send method.
int changeown(const std::string &path, uid_t u, gid_t g)
Change the ownership of 'path' to the entity described by {u,g}.