Skip to content

Commit

Permalink
Warn users about idleTimeout in Rocket
Browse files Browse the repository at this point in the history
Summary: Idle timeout is known not to work with Rocket connections. Warn users about this.

Reviewed By: avalonalex

Differential Revision: D60602123

fbshipit-source-id: c53accb2395d8858b41b97e688970cc0c7a1c100
  • Loading branch information
Akrama Baig Mirza authored and facebook-github-bot committed Aug 5, 2024
1 parent e815a2a commit 5accdd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions thrift/doc/languages/cpp/cpp2.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Useful (but not complete set of) options that can be set on the ThriftServer:

* `setIdleTimeout(std::chrono::milliseconds)` - milliseconds before we close idle connections.

:::caution
Idle timeout will not work for Rocket connections unless the `rocket_set_idle_connection_timeout` Thrift Flag is set to `true`.
:::

* `setTaskExpireTime(std::chrono::milliseconds)` - milliseconds before
we timeout any individual request. This can also be set on a
per-function bases by overriding the appropriate generated code
Expand Down
3 changes: 3 additions & 0 deletions thrift/lib/cpp2/server/ThriftServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,9 @@ class ThriftServer : public apache::thrift::concurrency::Runnable,
/** Set maximum number of milliseconds we'll wait for data (0 = infinity).
* Note: existing connections are unaffected by this call.
*
* WARNING: Idle timeout will not work for Rocket connections unless the
* rocket_set_idle_connection_timeout Thrift Flag is set to true.
*
* @param timeout number of milliseconds, or 0 to disable timeouts.
*/
void setIdleTimeout(
Expand Down

0 comments on commit 5accdd2

Please sign in to comment.