#include <helper.h>
Public Types | |
using | Requests = std::list< Xaction * > |
Public Member Functions | |
~helper_stateful_server () override | |
void | reserve () |
void | clearReservation () |
bool | reserved () override |
whether the server is locked for exclusive use by a client More... | |
void | closePipesSafely (const char *name) |
void | closeWritePipeSafely (const char *name) |
virtual void | dropQueued (Client &) |
dequeues and sends an Unknown answer to all queued requests More... | |
void | initStats () |
virtual void * | toCbdata ()=0 |
Static Public Member Functions | |
static void | HelperServerClosed (helper_stateful_server *srv) |
close handler to handle exited server processes More... | |
Public Attributes | |
statefulhelper::Pointer | parent |
Helper::ReservationId | reservationId |
"confirmation ID" of the last More... | |
time_t | reservationStart |
when the last reservation was made More... | |
const InstanceId< SessionBase > | index |
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 (helper_stateful_server) | |
virtual void | finalizedInCbdataChild ()=0 |
hack: ensure CBDATA_CHILD() after a toCbdata()-defining CBDATA_INTERMEDIATE() More... | |
Detailed Description
represents a single "stateful helper" process; supports exclusive transaction reservations
Member Typedef Documentation
◆ Requests
|
inherited |
Constructor & Destructor Documentation
◆ ~helper_stateful_server()
|
override |
Definition at line 175 of file helper.cc.
References assert, dlinkDelete(), and Comm::IsConnOpen().
Member Function Documentation
◆ CBDATA_CHILD()
|
private |
◆ clearReservation()
void helper_stateful_server::clearReservation | ( | ) |
Definition at line 651 of file helper.cc.
References debugs, and Ping::stats.
Referenced by statefulhelper::cancelReservation(), and statefulhelper::reserveServer().
◆ closePipesSafely()
|
inherited |
Closes pipes to the helper safely. Handles the case where the read and write pipes are the same FD.
- Parameters
-
name displayed 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()
|
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
-
name displayed 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()
|
virtualinherited |
Reimplemented in Helper::Session.
Definition at line 126 of file helper.cc.
References Helper::Client::callBack(), and Helper::Unknown.
Referenced by Helper::Session::dropQueued(), and HelperServerClosed().
◆ finalizedInCbdataChild()
|
privatepure virtualinherited |
◆ HelperServerClosed()
|
static |
Definition at line 921 of file helper.cc.
References Helper::SessionBase::dropQueued(), parent, and Helper::Client::sessionClosed().
Referenced by statefulhelper::openSessions().
◆ initStats()
|
inherited |
Definition at line 62 of file helper.cc.
References Helper::SessionBase::stats.
Referenced by statefulhelper::openSessions().
◆ reserve()
void helper_stateful_server::reserve | ( | ) |
Definition at line 642 of file helper.cc.
References assert, debugs, Helper::ReservationId::Next(), and squid_curtime.
Referenced by statefulhelper::reserveServer().
◆ reserved()
|
inlineoverridevirtual |
Implements Helper::SessionBase.
Definition at line 322 of file helper.h.
References reservationId, and Helper::ReservationId::reserved().
Referenced by helperStatefulServerDone(), helperStatefulShutdown(), statefulhelper::reserveServer(), and StatefulGetFirstAvailable().
◆ toCbdata()
|
pure virtualinherited |
Referenced by AsyncJob::callException(), and AsyncJob::callStart().
Member Data Documentation
◆ addr
|
inherited |
Definition at line 224 of file helper.h.
Referenced by statefulhelper::openSessions().
◆ answer_time
|
inherited |
Definition at line 234 of file helper.h.
Referenced by helperReturnBuffer(), and helperStatefulHandleRead().
◆ dispatch_time
|
inherited |
Definition at line 233 of file helper.h.
Referenced by helperReturnBuffer(), helperStatefulDispatch(), and helperStatefulHandleRead().
◆ flags
|
inherited |
◆ hIpc
|
inherited |
Definition at line 227 of file helper.h.
Referenced by statefulhelper::openSessions().
◆ index
|
inherited |
Helper program identifier; does not change when contents do, including during assignment
Definition at line 221 of file helper.h.
Referenced by GetFirstAvailable(), Helper::Client::handleKilledServer(), helperDispatch(), helperReturnBuffer(), helperStatefulDispatch(), helperStatefulHandleRead(), helperStatefulKickQueue(), helperStatefulShutdown(), and StatefulGetFirstAvailable().
◆ link
|
inherited |
Definition at line 236 of file helper.h.
Referenced by statefulhelper::openSessions().
◆ parent
statefulhelper::Pointer helper_stateful_server::parent |
Definition at line 327 of file helper.h.
Referenced by HelperServerClosed(), helperStatefulDispatch(), helperStatefulHandleRead(), helperStatefulServerDone(), and statefulhelper::openSessions().
◆ pending
|
inherited |
Definition at line 250 of file helper.h.
Referenced by GetFirstAvailable(), helperDispatch(), helperReturnBuffer(), helperStatefulDispatch(), helperStatefulHandleRead(), helperStatefulServerDone(), helperStatefulShutdown(), and StatefulGetFirstAvailable().
◆ pid
|
inherited |
Definition at line 223 of file helper.h.
Referenced by statefulhelper::openSessions().
◆ rbuf
|
inherited |
Definition at line 229 of file helper.h.
Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().
◆ rbuf_sz
|
inherited |
Definition at line 230 of file helper.h.
Referenced by helperReturnBuffer(), helperStatefulHandleRead(), and statefulhelper::openSessions().
◆ readPipe
|
inherited |
Definition at line 225 of file helper.h.
Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().
◆ releases
◆ replies
|
inherited |
Definition at line 249 of file helper.h.
Referenced by Helper::Client::handleKilledServer(), helperReturnBuffer(), and helperStatefulHandleRead().
◆ requests
|
inherited |
Definition at line 245 of file helper.h.
Referenced by helperDispatch(), helperStatefulDispatch(), and helperStatefulHandleRead().
◆ reservationId
Helper::ReservationId helper_stateful_server::reservationId |
Definition at line 333 of file helper.h.
Referenced by helperStatefulDispatch(), helperStatefulHandleRead(), reserved(), statefulhelper::reserveServer(), and StatefulGetFirstAvailable().
◆ reservationStart
time_t helper_stateful_server::reservationStart |
Definition at line 334 of file helper.h.
Referenced by statefulhelper::openSessions(), and StatefulGetFirstAvailable().
◆ roffset
|
inherited |
Definition at line 231 of file helper.h.
Referenced by helperStatefulHandleRead(), and statefulhelper::openSessions().
◆
struct { ... } Helper::SessionBase::stats |
◆ timedout
◆ uses
|
inherited |
Definition at line 248 of file helper.h.
Referenced by helperDispatch(), and helperStatefulDispatch().
◆ 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: