irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rodsServer.hpp File Reference
#include <stdarg.h>
#include <unistd.h>
#include <signal.h>
#include <sys/wait.h>
#include "rods.h"
#include "rcGlobalExtern.h"
#include "rsLog.hpp"
#include "rodsLog.h"
#include "sockComm.h"
#include "rsIcatOpr.hpp"
#include "getRodsEnv.h"
#include "rcConnect.h"
#include <vector>
Include dependency graph for rodsServer.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_EXEC_ENV   10 /* max number of env for execv */
 
#define MAX_SVR_SVR_CONNECT_CNT   7 /* avoid recurive connect */
 
#define MIN_AGENT_TIMEOUT_TIME   7200
 
#define MAX_ACCEPT_ERR_CNT   1000
 
#define NUM_READ_WORKER_THR   5
 
#define RE_CACHE_SALT_NUM_RANDOM_BYTES   40
 
#define AGENT_QUE_CHK_INT
 

Functions

int serverize (char *logDir)
 
int serverMain (char *logDir)
 
int procChildren (agentProc_t **agentProcHead)
 
agentProc_tgetAgentProcByPid (int childPid, agentProc_t **agentProcHead)
 
void serverExit ()
 
void usage (char *prog)
 
int initServer (rsComm_t *svrComm)
 
int spawnAgent (agentProc_t *connReq, agentProc_t **agentProcHead)
 
int execAgent (int newSock, startupPack_t *startupPack)
 
int getAgentProcCnt ()
 
int chkAgentProcCnt ()
 
int getAgentProcPIDs (std::vector< int > &_pids)
 
int chkConnectedAgentProcQue ()
 
int recordServerProcess (rsComm_t *svrComm)
 
int initServerMain (rsComm_t *svrComm)
 
int addConnReqToQue (rsComm_t *rsComm, int sock)
 
int initConnThreadEnv ()
 
agentProc_tgetConnReqFromQue ()
 
void readWorkerTask ()
 
int procSingleConnReq (agentProc_t *connReq)
 
int startProcConnReqThreads ()
 
void stopProcConnReqThreads ()
 
void spawnManagerTask ()
 
int procBadReq ()
 
void purgeLockFileWorkerTask ()
 

Variables

char * optarg
 
int optind
 
int opterr
 
int optopt
 

Macro Definition Documentation

◆ AGENT_QUE_CHK_INT

#define AGENT_QUE_CHK_INT
Value:
600 /* check the agent queue every 600 sec
* for consistence */

Definition at line 45 of file rodsServer.hpp.

◆ MAX_ACCEPT_ERR_CNT

#define MAX_ACCEPT_ERR_CNT   1000

Definition at line 39 of file rodsServer.hpp.

◆ MAX_EXEC_ENV

#define MAX_EXEC_ENV   10 /* max number of env for execv */

Definition at line 34 of file rodsServer.hpp.

◆ MAX_SVR_SVR_CONNECT_CNT

#define MAX_SVR_SVR_CONNECT_CNT   7 /* avoid recurive connect */

Definition at line 35 of file rodsServer.hpp.

◆ MIN_AGENT_TIMEOUT_TIME

#define MIN_AGENT_TIMEOUT_TIME   7200

Definition at line 37 of file rodsServer.hpp.

◆ NUM_READ_WORKER_THR

#define NUM_READ_WORKER_THR   5

Definition at line 41 of file rodsServer.hpp.

◆ RE_CACHE_SALT_NUM_RANDOM_BYTES

#define RE_CACHE_SALT_NUM_RANDOM_BYTES   40

Definition at line 43 of file rodsServer.hpp.

Function Documentation

◆ addConnReqToQue()

int addConnReqToQue ( rsComm_t rsComm,
int  sock 
)

Definition at line 1288 of file rodsServer.cpp.

References BOTTOM_POS, ConnReqHead, queAgentProc(), ReadReqCond, ReadReqCondMutex, rsComm_t::remoteAddr, agentProc::remoteAddr, and agentProc::sock.

Referenced by serverMain().

Here is the call graph for this function:

◆ chkAgentProcCnt()

int chkAgentProcCnt ( )

Definition at line 1021 of file rodsServer.cpp.

References chkConnectedAgentProcQue(), terminate_irods_processes::e, getAgentProcCnt(), KEY_NOT_FOUND, irods::log(), NO_MAX_CONNECTION_LIMIT, and SYS_MAX_CONNECT_COUNT_EXCEEDED.

Referenced by serverMain().

Here is the call graph for this function:

◆ chkConnectedAgentProcQue()

int chkConnectedAgentProcQue ( )

Definition at line 1047 of file rodsServer.cpp.

References ConnectedAgentHead, ConnectedAgentMutex, irods::experimental::administration::client::v1::exists(), LOG_DEBUG, MAX_NAME_LEN, agentProc::next, NULL, pid_age::p, agentProc::pid, ProcLogDir, and rodsLog().

Referenced by chkAgentProcCnt().

Here is the call graph for this function:

◆ execAgent()

◆ getAgentProcByPid()

agentProc_t* getAgentProcByPid ( int  childPid,
agentProc_t **  agentProcHead 
)

Definition at line 695 of file rodsServer.cpp.

References ConnectedAgentMutex, agentProc::next, NULL, and agentProc::pid.

◆ getAgentProcCnt()

int getAgentProcCnt ( )

◆ getAgentProcPIDs()

int getAgentProcPIDs ( std::vector< int > &  _pids)

◆ getConnReqFromQue()

agentProc_t* getConnReqFromQue ( )

Definition at line 1310 of file rodsServer.cpp.

References ConnReqHead, irods::server_state::EXITED, irods::server_state::instance(), agentProc::next, NULL, ReadReqCond, ReadReqCondMutex, and irods::server_state::STOPPED.

Referenced by readWorkerTask().

Here is the call graph for this function:

◆ initConnThreadEnv()

int initConnThreadEnv ( )

Definition at line 1305 of file rodsServer.cpp.

Referenced by startProcConnReqThreads().

◆ initServer()

◆ initServerMain()

◆ procBadReq()

int procBadReq ( )

Definition at line 1599 of file rodsServer.cpp.

References BadReqHead, BadReqMutex, agentProc::next, and NULL.

Referenced by spawnManagerTask().

◆ procChildren()

int procChildren ( agentProc_t **  agentProcHead)

Definition at line 663 of file rodsServer.cpp.

References ConnectedAgentMutex, agentProc::next, NULL, and agentProc::pid.

Referenced by serverMain().

◆ procSingleConnReq()

◆ purgeLockFileWorkerTask()

void purgeLockFileWorkerTask ( )

Definition at line 1620 of file rodsServer.cpp.

References irods::server_state::EXITED, irods::server_state::instance(), LOCK_FILE_PURGE_TIME, LOG_ERROR, purgeLockFileDir(), rodsLogError(), rodsSleep(), irods::SERVER_CONTROL_POLLING_TIME_MILLI_SEC, irods.pypyodbc::status, and irods::server_state::STOPPED.

Referenced by serverMain().

Here is the call graph for this function:

◆ readWorkerTask()

◆ recordServerProcess()

int recordServerProcess ( rsComm_t svrComm)

Definition at line 1140 of file rodsServer.cpp.

References LOG_ERROR, rsComm_t::myEnv, myPid, NULL, rodsLog(), and rodsEnv::rodsPort.

Referenced by initServerMain(), and serverExit().

Here is the call graph for this function:

◆ serverExit()

void serverExit ( )

Definition at line 633 of file rodsServer.cpp.

References agent_conn_socket, agent_factory_socket_dir, agent_factory_socket_file, agent_spawning_pid, LOG_NOTICE, NULL, recordServerProcess(), and rodsLog().

Referenced by main().

Here is the call graph for this function:

◆ serverize()

int serverize ( char *  logDir)

Definition at line 308 of file rodsServer.cpp.

References getLogfileName(), LOG_NOTICE, LogFd, NULL, RODS_SERVER_LOGFILE, and rodsLog().

Referenced by main().

Here is the call graph for this function:

◆ serverMain()

◆ spawnAgent()

int spawnAgent ( agentProc_t connReq,
agentProc_t **  agentProcHead 
)

Definition at line 723 of file rodsServer.cpp.

References execAgent(), NULL, queueConnectedAgentProc(), agentProc::sock, agentProc::startupPack, and USER__NULL_INPUT_ERR.

Referenced by procSingleConnReq(), and spawnManagerTask().

Here is the call graph for this function:

◆ spawnManagerTask()

◆ startProcConnReqThreads()

int startProcConnReqThreads ( )

Definition at line 1342 of file rodsServer.cpp.

References initConnThreadEnv(), LOG_ERROR, NUM_READ_WORKER_THR, readWorkerTask(), ReadWorkerThread, rodsLog(), spawnManagerTask(), SpawnManagerThread, and SYS_THREAD_RESOURCE_ERR.

Referenced by serverMain().

Here is the call graph for this function:

◆ stopProcConnReqThreads()

void stopProcConnReqThreads ( )

Definition at line 1365 of file rodsServer.cpp.

References LOG_ERROR, NUM_READ_WORKER_THR, ReadReqCond, ReadWorkerThread, rodsLog(), SpawnManagerThread, and SpawnReqCond.

Referenced by serverMain().

Here is the call graph for this function:

◆ usage()

void usage ( char *  prog)

Definition at line 97 of file irodsXmsgServer.cpp.

Referenced by main().

Variable Documentation

◆ optarg

char* optarg

Referenced by main(), and parseCmdLineOpt().

◆ opterr

int opterr

Definition at line 32 of file rodsServer.hpp.

Referenced by parseCmdLineOpt().

◆ optind

int optind

Referenced by parseCmdLineOpt().

◆ optopt

int optopt

Definition at line 32 of file rodsServer.hpp.

Referenced by parseCmdLineOpt().