Skip to content

Workspace cookie decode-failure logging: TTL eviction instead of bulk-clear #933

@bjagg

Description

@bjagg

Follow-up from PR #914 review (@cbeach47).

components/lif/mdr_auth/workspace_cookie.py currently dedupes cookie-decode-failure INFO logs by maintaining a bounded set (_LOGGED_DECODE_FAILURES) and bulk-clearing it when it hits 256 entries. This is a crude eviction that works for the common case but has a sharp edge: if a process sees 256 distinct bad cookies quickly, the next batch re-logs them all when the set clears.

A TTL-based eviction (e.g., evict entries older than N minutes) would smooth this out and avoid the burst re-log behavior, while still capping memory.

Not critical — the bulk-clear path is correct, just suboptimal. Worth picking up next time we touch this file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions