Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix timeout on connection
The connector was always configured to use a one second timeout.
  • Loading branch information
markus456 committed May 18, 2018
1 parent da9a346 commit 5ed54d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions maxscale-cdc-adapter/mxs_adapter.cpp
Expand Up @@ -273,7 +273,7 @@ int main(int argc, char *argv[])
{
driver = config.empty() ? new mcsapi::ColumnStoreDriver() : new mcsapi::ColumnStoreDriver(config);
// Here is where make connection to MaxScale to receive CDC
CDC::Connection cdcConnection(mxsIPAddr, mxsCDCPort, mxsUser, mxsPassword, 1);
CDC::Connection cdcConnection(mxsIPAddr, mxsCDCPort, mxsUser, mxsPassword, timeOut);

// TODO: one thread per table, for now one table per process
if (!processTable(driver, &cdcConnection, mxsDbName, mxsTblName))
Expand Down Expand Up @@ -375,7 +375,7 @@ bool processTable(mcsapi::ColumnStoreDriver* driver, CDC::Connection * cdcConnec
{
if (!(row = cdcConnection->read()))
{
if (cdcConnection->error() == CDC::TIMEOUT && n_reads < timeOut)
if (cdcConnection->error() == CDC::TIMEOUT)
{
if (difftime(time(NULL), init) >= idleFlushPeriod)
{
Expand Down

0 comments on commit 5ed54d5

Please sign in to comment.