Skip to content

[Feature Request] support explicit grace period update strategies #444

@HunterLarco

Description

@HunterLarco

It's unclear based on the current documentation how spawn requests for already existing backends resolve conflicting grace periods. For example, if I spawn a backend for lock foo with a grace_period of 60s and then 15s later spawn it again with the lock foo and grace_period of 300s, my understanding is that a duplicate backend will not be started. But the behavior of the grace_period is now undefined.

Will it

  1. remain at 60s with45s left
  2. remain at 60s with 60s left
  3. now be at 300s with 255s left
  4. now be 300s with 300s left

Ideally I'd like an enum field on the spawn request that can define which strategy to use (defaulting to the existing behavior for backwards compat I imagine). However, a strategy that my team in particular would benefit from is a strategy where grace periods are reset to the new requested value only if they're larger than the previous grace period. e.g. GracePeriodStrategy.LARGEST_WINS.

The reason for this is that we have two codepaths which spawn backends. The first is triggered by users who are connecting to a backend. In this codepath we set a generous grace period anticipating that users may become disconnected and reconnect. The second is automation in our backend which spawns backends with a small grace period since (assuming no users are online already) we know the scope of interaction is small. In this pattern, largest wins allows us to upgrade to a longer session is a user does connect and prevents downgrading when automation runs if a user is already online.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions