Page Speed Optimization Libraries
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
net_instaweb::CentralControllerRpcClient Class Reference

#include "central_controller_rpc_client.h"

Inheritance diagram for net_instaweb::CentralControllerRpcClient:

Public Member Functions

 CentralControllerRpcClient (const GoogleString &server_address, int panic_threshold, ThreadSystem *thread_system, Timer *timer, Statistics *statistics, MessageHandler *handler)
void ScheduleExpensiveOperation (ExpensiveOperationCallback *callback) override
 CentralController implementation.
void ScheduleRewrite (ScheduleRewriteCallback *callback) override
void ShutDown () override LOCKS_EXCLUDED(mutex_)

Static Public Member Functions

static void InitStats (Statistics *stats)

Static Public Attributes

static const char kControllerReconnectTimeStatistic []
static const int kControllerReconnectDelayMs

Detailed Description

CentralController implementation that forwards all requests to a gRPC server. RewriteDrivers wait for the controller response (possibly detaching) before proceeding to rewrite. If the controller stops responding but requests keep coming in, we could keep creating RewriteDrivers indefinitely and eat all available memory. To guard against this we looks at the number of outstanding gRPC requests. If that ever exceeds the max possible number, we declare the controller to have hung, cancel all outstanding requests and stop talking to it. We signal this via a statistic, so all processes can notice and do the same.

Member Function Documentation

void net_instaweb::CentralControllerRpcClient::ScheduleRewrite ( ScheduleRewriteCallback callback)

Runs callback at an indeterminate time in the future when the associated rewrite should be performed. May Cancel the callback immediately or at some point in the future if the rewrite should not be performed by the caller. Only one rewrite per callback.key() will be scheduled at once.

Implements net_instaweb::CentralController.

void net_instaweb::CentralControllerRpcClient::ShutDown ( )

Implementations of this method should try to cancel any pending operations ASAP, and immediately reject new incoming ones. This method should behave safely when called more than once.

Implements net_instaweb::CentralController.

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