Skip to content

Commit

Permalink
Ignore watch timeout when not user request. (#1604)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barenboim authored Aug 9, 2024
1 parent ef1a526 commit 5766424
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/factory/HttpTaskImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ class ComplexHttpProxyTask : public ComplexHttpTask
virtual CommMessageOut *message_out();
virtual CommMessageIn *message_in();
virtual int keep_alive_timeout();
virtual int first_timeout();
virtual bool init_success();
virtual bool finish_once();

Expand Down Expand Up @@ -652,6 +653,11 @@ int ComplexHttpProxyTask::keep_alive_timeout()
return this->ComplexHttpTask::keep_alive_timeout();
}

int ComplexHttpProxyTask::first_timeout()
{
return is_user_request_ ? this->watch_timeo : 0;
}

bool ComplexHttpProxyTask::init_success()
{
if (!uri_.scheme || strcasecmp(uri_.scheme, "http") != 0)
Expand Down
6 changes: 6 additions & 0 deletions src/factory/MySQLTaskImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ class ComplexMySQLTask : public WFComplexClientTask<MySQLRequest, MySQLResponse>
virtual CommMessageOut *message_out();
virtual CommMessageIn *message_in();
virtual int keep_alive_timeout();
virtual int first_timeout();
virtual bool init_success();
virtual bool finish_once();

Expand Down Expand Up @@ -523,6 +524,11 @@ int ComplexMySQLTask::keep_alive_timeout()
return MYSQL_KEEPALIVE_DEFAULT;
}

int ComplexMySQLTask::first_timeout()
{
return is_user_request_ ? this->watch_timeo : 0;
}

/*
+--------------------+---------------------+-----+
| CHARACTER_SET_NAME | COLLATION_NAME | ID |
Expand Down
6 changes: 6 additions & 0 deletions src/factory/RedisTaskImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class ComplexRedisTask : public WFComplexClientTask<RedisRequest, RedisResponse>
virtual CommMessageOut *message_out();
virtual CommMessageIn *message_in();
virtual int keep_alive_timeout();
virtual int first_timeout();
virtual bool init_success();
virtual bool finish_once();

Expand Down Expand Up @@ -142,6 +143,11 @@ int ComplexRedisTask::keep_alive_timeout()
return succ_ ? REDIS_KEEPALIVE_DEFAULT : 0;
}

int ComplexRedisTask::first_timeout()
{
return is_user_request_ ? this->watch_timeo : 0;
}

bool ComplexRedisTask::init_success()
{
enum TransportType type;
Expand Down

0 comments on commit 5766424

Please sign in to comment.