Moved the housekeeper heartbeat to a separate header for ease of integration.

This keeps the behavior the same but allows the heartbeat to be used as a crude timer
without including everything the housekeeper.h header includes.

Moved the protocol level updates on the DCBs last_read value into dcb_read.
This keeps the implementation nice and compact.
This commit is contained in:
Markus Makela
2015-02-24 05:00:16 +02:00
parent 4f108af0fb
commit aa4932bf2d
8 changed files with 39 additions and 28 deletions

View File

@ -98,22 +98,31 @@ hkinit();
skygw_log_sync_all();
ss_info_dassert(0 != result, "Start all should succeed");
ss_dfprintf(stderr, "\t..done\nTiming out a session.");
service->conn_timeout = 1;
dcb = dcb_alloc(DCB_ROLE_REQUEST_HANDLER);
ss_info_dassert(dcb != NULL, "DCB allocation failed");
ss_dfprintf(stderr, "\t..done\nTiming out a session.");
session = session_alloc(service,dcb);
ss_info_dassert(session != NULL, "Session allocation failed");
session->client->state = DCB_STATE_POLLING;
session->client->func.hangup = hup;
sleep(30);
service->conn_timeout = 1;
result = serviceStart(service);
skygw_log_sync_all();
ss_info_dassert(0 != result, "Start should succeed");
result = serviceStop(service);
skygw_log_sync_all();
ss_info_dassert(0 != result, "Stop should succeed");
ss_info_dassert(success, "Session allocation failed");
dcb = dcb_alloc(DCB_ROLE_REQUEST_HANDLER);
ss_info_dassert(dcb != NULL, "DCB allocation failed");
session = session_alloc(service,dcb);
ss_info_dassert(session != NULL, "Session allocation failed");
session->client->state = DCB_STATE_POLLING;
session->client->func.hangup = hup;
sleep(15);
ss_info_dassert(success, "Session timeout failed");
ss_dfprintf(stderr, "\t..done\nStopping Service.");
ss_info_dassert(0 != serviceStop(service), "Stop should succeed");
ss_dfprintf(stderr, "\t..done\n");
ss_dfprintf(stderr, "\t..done\n");
/** This is never used in MaxScale and will always fail due to service's
* stats.n_current value never being decremented */
/*