#include <helper.h>

Inheritance diagram for Helper::Session:
Collaboration diagram for Helper::Session:

Public Types

typedef std::map< uint64_t, Requests::iterator > RequestIndex
 
using Requests = std::list< Xaction * >
 

Public Member Functions

 ~Session () override
 
XactionpopRequest (int requestId)
 
void checkForTimedOutRequests (bool const retry)
 
bool reserved () override
 whether the server is locked for exclusive use by a client More...
 
void dropQueued (Client &) override
 dequeues and sends an Unknown answer to all queued requests More...
 
void closePipesSafely (const char *name)
 
void closeWritePipeSafely (const char *name)
 
void initStats ()
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static void requestTimeout (const CommTimeoutCbParams &io)
 Read timeout handler. More...
 
static void HelperServerClosed (Session *)
 close handler to handle exited server processes More...
 

Public Attributes

uint64_t nextRequestId
 
MemBufwqueue
 
MemBufwritebuf
 
Client::Pointer parent
 
XactionreplyXaction
 
bool ignoreToEom
 Whether to ignore current message, because it is timed-out or other reason. More...
 
RequestIndex requestsIndex
 maps request IDs to requests More...
 
const InstanceId< SessionBaseindex
 
int pid
 
Ip::Address addr
 
Comm::ConnectionPointer readPipe
 
Comm::ConnectionPointer writePipe
 
void * hIpc
 
char * rbuf
 
size_t rbuf_sz
 
size_t roffset
 
struct timeval dispatch_time
 
struct timeval answer_time
 
dlink_node link
 
struct Helper::SessionBase::_helper_flags flags
 
Requests requests
 requests in order of submission/expiration More...
 
struct {
   uint64_t   uses
 
   uint64_t   replies
 
   uint64_t   pending
 
   uint64_t   releases
 
   uint64_t   timedout
 
stats
 

Private Member Functions

 CBDATA_CHILD (Session)
 
virtual void finalizedInCbdataChild ()=0
 hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More...
 

Detailed Description

represents a single "stateless helper" process; supports concurrent helper requests

Definition at line 259 of file helper.h.

Member Typedef Documentation

◆ RequestIndex

typedef std::map<uint64_t, Requests::iterator> Helper::Session::RequestIndex

Definition at line 281 of file helper.h.

◆ Requests

using Helper::SessionBase::Requests = std::list<Xaction *>
inherited

Definition at line 244 of file helper.h.

Constructor & Destructor Documentation

◆ ~Session()

Helper::Session::~Session ( )
override

Definition at line 146 of file helper.cc.

References assert, dlinkDelete(), and Comm::IsConnOpen().

Member Function Documentation

◆ CBDATA_CHILD()

Helper::Session::CBDATA_CHILD ( Session  )
private

◆ checkForTimedOutRequests()

void Helper::Session::checkForTimedOutRequests ( bool const  retry)

Run over the active requests lists and forces a retry, or timedout reply or the configured "on timeout response" for timedout requests.

Definition at line 1550 of file helper.cc.

References assert, cbdataReferenceValid(), debugs, MAX_RETRIES, Ping::stats, and Helper::TimedOut.

Referenced by helperReturnBuffer(), and requestTimeout().

◆ closePipesSafely()

void Helper::SessionBase::closePipesSafely ( const char *  name)
inherited

Closes pipes to the helper safely. Handles the case where the read and write pipes are the same FD.

Parameters
namedisplayed for the helper being shutdown if logging an error

Definition at line 72 of file helper.cc.

References DBG_IMPORTANT, debugs, getCurrentTime(), hIpc, and pid.

Referenced by helperReturnBuffer(), helperStatefulHandleRead(), and helperStatefulShutdown().

◆ closeWritePipeSafely()

void Helper::SessionBase::closeWritePipeSafely ( const char *  name)
inherited

Closes the reading pipe. If the read and write sockets are the same the write pipe will also be closed. Otherwise its left open for later handling.

Parameters
namedisplayed for the helper being shutdown if logging an error

Definition at line 100 of file helper.cc.

References DBG_IMPORTANT, debugs, getCurrentTime(), hIpc, and pid.

Referenced by helperReturnBuffer(), and helperStatefulServerDone().

◆ dropQueued()

void Helper::Session::dropQueued ( Client client)
overridevirtual

Reimplemented from Helper::SessionBase.

Definition at line 169 of file helper.cc.

References Helper::SessionBase::dropQueued().

Referenced by HelperServerClosed().

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ HelperServerClosed()

void Helper::Session::HelperServerClosed ( Session srv)
static

Definition at line 912 of file helper.cc.

References dropQueued(), parent, and Helper::Client::sessionClosed().

Referenced by Helper::Client::openSessions().

◆ initStats()

void Helper::SessionBase::initStats ( )
inherited

Definition at line 62 of file helper.cc.

References Helper::SessionBase::stats.

Referenced by statefulhelper::openSessions().

◆ popRequest()

Helper::Xaction * Helper::Session::popRequest ( int  requestId)

Search in queue for the request with requestId, return the related Xaction object and remove it from queue. If concurrency is disabled then the requestId is ignored and the Xaction of the next request in queue is retrieved.

Definition at line 929 of file helper.cc.

◆ requestTimeout()

◆ reserved()

bool Helper::Session::reserved ( )
inlineoverridevirtual

Implements Helper::SessionBase.

Definition at line 297 of file helper.h.

◆ toCbdata()

virtual void * CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ addr

Ip::Address Helper::SessionBase::addr
inherited

Definition at line 224 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ answer_time

struct timeval Helper::SessionBase::answer_time
inherited

Definition at line 234 of file helper.h.

Referenced by helperReturnBuffer(), and helperStatefulHandleRead().

◆ dispatch_time

struct timeval Helper::SessionBase::dispatch_time
inherited

Definition at line 233 of file helper.h.

Referenced by helperReturnBuffer(), helperStatefulDispatch(), and helperStatefulHandleRead().

◆ flags

◆ hIpc

void* Helper::SessionBase::hIpc
inherited

Definition at line 227 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ ignoreToEom

bool Helper::Session::ignoreToEom

Definition at line 278 of file helper.h.

◆ index

const InstanceId<SessionBase> Helper::SessionBase::index
inherited

◆ link

dlink_node Helper::SessionBase::link
inherited

Definition at line 236 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ nextRequestId

uint64_t Helper::Session::nextRequestId

Definition at line 264 of file helper.h.

Referenced by helperDispatch().

◆ parent

Client::Pointer Helper::Session::parent

Definition at line 269 of file helper.h.

Referenced by helperDispatch(), helperHandleRead(), helperReturnBuffer(), and HelperServerClosed().

◆ pending

◆ pid

int Helper::SessionBase::pid
inherited

Definition at line 223 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ rbuf

char* Helper::SessionBase::rbuf
inherited

Definition at line 229 of file helper.h.

Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().

◆ rbuf_sz

size_t Helper::SessionBase::rbuf_sz
inherited

◆ readPipe

Comm::ConnectionPointer Helper::SessionBase::readPipe
inherited

Definition at line 225 of file helper.h.

Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().

◆ releases

uint64_t Helper::SessionBase::releases
inherited

Definition at line 251 of file helper.h.

◆ replies

uint64_t Helper::SessionBase::replies
inherited

◆ replyXaction

Xaction* Helper::Session::replyXaction

The helper request Xaction object for the current reply . A helper reply may be distributed to more than one of the retrieved packets from helper. This member stores the Xaction object as long as the end-of-message for current reply is not retrieved.

Definition at line 275 of file helper.h.

Referenced by helperReturnBuffer().

◆ requests

Requests Helper::SessionBase::requests
inherited

Definition at line 245 of file helper.h.

Referenced by helperDispatch(), helperStatefulDispatch(), and helperStatefulHandleRead().

◆ requestsIndex

RequestIndex Helper::Session::requestsIndex

Definition at line 282 of file helper.h.

Referenced by helperDispatch().

◆ roffset

size_t Helper::SessionBase::roffset
inherited

Definition at line 231 of file helper.h.

Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().

◆ 

◆ timedout

uint64_t Helper::SessionBase::timedout
inherited

Definition at line 252 of file helper.h.

◆ uses

uint64_t Helper::SessionBase::uses
inherited

Definition at line 248 of file helper.h.

Referenced by helperDispatch(), and helperStatefulDispatch().

◆ wqueue

MemBuf* Helper::Session::wqueue

Definition at line 266 of file helper.h.

Referenced by helperDispatch().

◆ writebuf

MemBuf* Helper::Session::writebuf

Definition at line 267 of file helper.h.

Referenced by helperDispatch(), and helperDispatchWriteDone().

◆ writePipe

Comm::ConnectionPointer Helper::SessionBase::writePipe
inherited

Definition at line 226 of file helper.h.

Referenced by helperDispatch(), helperStatefulDispatch(), and statefulhelper::openSessions().


The documentation for this class was generated from the following files:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors