Skip to content

Stateful Session cookies incompatible between Envoy Processes. #44111

@bbassingthwaite

Description

@bbassingthwaite

Title: Stateful Session cookies incompatible between Envoy Processes.

Description:
When using Envoy as an Edge Proxy with multiple instances (an NLB in front) AND using the StatefulSession with cookies doesn't work properly.

The cookie is encoded with the expiry time BUT it uses the monotonic clock:

const auto expiry_time = std::chrono::duration_cast<std::chrono::seconds>(
(time_source_.monotonicTime() + std::chrono::seconds(factory_.ttl_)).time_since_epoch());

When HTTP requests are routed to different Envoy processes, they will have different values for their monotonic clock and the cookie can inadvertently expire sooner then its should, which will cause a new backend to get selected.

I believe the appropriate fix is for time_source_.systemTime() to be used so that two envoy processes can validate each other cookies.

cc @cpakulski

Metadata

Metadata

Assignees

Labels

bugtriageIssue requires triage

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions