#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 () override
 dequeues and sends an Unknown answer to all queued requests More...
 
Clienthelper () const override
 our creator (parent) object More...
 
void closePipesSafely ()
 
void closeWritePipeSafely ()
 
void initStats ()
 
virtual void * toCbdata ()=0
 

Static Public Member Functions

static void requestTimeout (const CommTimeoutCbParams &io)
 Read timeout handler. More...
 
static void HelperServerClosed (SessionBase *)
 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 262 of file helper.h.

Member Typedef Documentation

◆ RequestIndex

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

Definition at line 284 of file helper.h.

◆ Requests

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

Definition at line 247 of file helper.h.

Constructor & Destructor Documentation

◆ ~Session()

Helper::Session::~Session ( )
override

Definition at line 142 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 1563 of file helper.cc.

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

Referenced by helperReturnBuffer(), and requestTimeout().

◆ closePipesSafely()

void Helper::SessionBase::closePipesSafely ( )
inherited

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

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 ( )
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.

Definition at line 98 of file helper.cc.

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

Referenced by helperReturnBuffer(), and helperStatefulServerDone().

◆ dropQueued()

void Helper::Session::dropQueued ( )
overridevirtual

Reimplemented from Helper::SessionBase.

Definition at line 165 of file helper.cc.

References Helper::SessionBase::dropQueued().

◆ finalizedInCbdataChild()

virtual void CbdataParent::finalizedInCbdataChild ( )
privatepure virtualinherited

◆ helper()

Client& Helper::Session::helper ( ) const
inlineoverridevirtual

Implements Helper::SessionBase.

Definition at line 302 of file helper.h.

References parent.

◆ HelperServerClosed()

void Helper::SessionBase::HelperServerClosed ( SessionBase srv)
staticinherited

◆ 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 936 of file helper.cc.

◆ requestTimeout()

void Helper::Session::requestTimeout ( const CommTimeoutCbParams io)
static

◆ reserved()

bool Helper::Session::reserved ( )
inlineoverridevirtual

Implements Helper::SessionBase.

Definition at line 300 of file helper.h.

◆ toCbdata()

virtual void* CbdataParent::toCbdata ( )
pure virtualinherited

Member Data Documentation

◆ addr

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

Definition at line 227 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ answer_time

struct timeval Helper::SessionBase::answer_time
inherited

Definition at line 237 of file helper.h.

Referenced by helperReturnBuffer(), and helperStatefulHandleRead().

◆ dispatch_time

struct timeval Helper::SessionBase::dispatch_time
inherited

Definition at line 236 of file helper.h.

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

◆ flags

◆ hIpc

void* Helper::SessionBase::hIpc
inherited

Definition at line 230 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ ignoreToEom

bool Helper::Session::ignoreToEom

Definition at line 281 of file helper.h.

◆ index

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

◆ link

dlink_node Helper::SessionBase::link
inherited

Definition at line 239 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ nextRequestId

uint64_t Helper::Session::nextRequestId

Definition at line 267 of file helper.h.

Referenced by helperDispatch().

◆ parent

Client::Pointer Helper::Session::parent

Definition at line 272 of file helper.h.

Referenced by helper(), helperDispatch(), and helperHandleRead().

◆ pending

◆ pid

int Helper::SessionBase::pid
inherited

Definition at line 226 of file helper.h.

Referenced by statefulhelper::openSessions().

◆ rbuf

char* Helper::SessionBase::rbuf
inherited

Definition at line 232 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 228 of file helper.h.

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

◆ releases

uint64_t Helper::SessionBase::releases
inherited

Definition at line 254 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 278 of file helper.h.

Referenced by helperReturnBuffer().

◆ requests

Requests Helper::SessionBase::requests
inherited

Definition at line 248 of file helper.h.

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

◆ requestsIndex

RequestIndex Helper::Session::requestsIndex

Definition at line 285 of file helper.h.

Referenced by helperDispatch().

◆ roffset

size_t Helper::SessionBase::roffset
inherited

Definition at line 234 of file helper.h.

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

◆ stats

◆ timedout

uint64_t Helper::SessionBase::timedout
inherited

Definition at line 255 of file helper.h.

◆ uses

uint64_t Helper::SessionBase::uses
inherited

Definition at line 251 of file helper.h.

Referenced by helperDispatch(), and helperStatefulDispatch().

◆ wqueue

MemBuf* Helper::Session::wqueue

Definition at line 269 of file helper.h.

Referenced by helperDispatch().

◆ writebuf

MemBuf* Helper::Session::writebuf

Definition at line 270 of file helper.h.

Referenced by helperDispatch(), and helperDispatchWriteDone().

◆ writePipe

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

Definition at line 229 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