Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace session upload grace period with session tracker #11551

Merged
merged 12 commits into from
Apr 8, 2022

Conversation

Joerger
Copy link
Contributor

@Joerger Joerger commented Mar 29, 2022

Changes:

  • Update session_tracker expiration logic.
    • Once the SessionTracker.Expiry(), is reached, it will be removed from the backend.
    • If SessionTracker.Spec.Expires is set, it will be a strict expiration which won't be affected by the following dynamics.
      • This is used by kube sessions, which have a hard set expiration of 24 hours.
  • Add SessionTrackerUpdateExpiry grpc request to enable dynamic updates of the session expiration based on session state.
    • In PENDING state, the session tracker will expire after 1 hour.
    • In 'RUNNING` state, if the session is active, the expiration will be extended every 10 minutes. As a result, the session will expire 1 hour after the session ends.
    • If the session is TERMINATED, then the expiration will be set to time.Now() to mark it for immediate removal.
  • Update Upload completer to check for abandoned uploads by checking if the associated session has a non-expired tracker.

@Joerger Joerger force-pushed the joerger/grace-period-fixes branch from 22e1735 to 7fa8705 Compare March 29, 2022 23:50
@Joerger Joerger marked this pull request as ready for review March 29, 2022 23:51
@Joerger Joerger requested review from xacrimon and zmb3 March 29, 2022 23:51
@github-actions github-actions bot added the audit-log Issues related to Teleports Audit Log label Mar 29, 2022
@github-actions github-actions bot requested review from atburke and smallinsky March 29, 2022 23:51
@Joerger Joerger force-pushed the joerger/grace-period-fixes branch from f3c370f to a61117e Compare April 1, 2022 22:31
api/client/proto/authservice.proto Outdated Show resolved Hide resolved
lib/events/complete.go Outdated Show resolved Hide resolved
lib/srv/regular/sshserver_test.go Outdated Show resolved Hide resolved
lib/srv/regular/sshserver_test.go Outdated Show resolved Hide resolved
lib/srv/regular/sshserver_test.go Outdated Show resolved Hide resolved
lib/srv/sess.go Outdated Show resolved Hide resolved
lib/srv/sess.go Show resolved Hide resolved
@xacrimon
Copy link
Contributor

xacrimon commented Apr 3, 2022

Sorry, meant to post a suggestion diff comment but tripped up in the VSCode online UI and accidentally pushed a commit with the change, please have a look at the commit and see if it looks reasonable.

@Joerger Joerger requested a review from zmb3 April 4, 2022 20:03
Joerger and others added 4 commits April 6, 2022 10:02
…king to accurately determine whether an upload has been abandoned;

Update session tracker expiration to be 1 hour, and dynamically extend it while the session is active.
@Joerger Joerger force-pushed the joerger/grace-period-fixes branch from c9346af to c61e2a4 Compare April 6, 2022 17:02
@Joerger Joerger enabled auto-merge (squash) April 8, 2022 00:58
@Joerger Joerger merged commit aba0b0c into master Apr 8, 2022
@Joerger Joerger deleted the joerger/grace-period-fixes branch April 8, 2022 23:40
Joerger added a commit that referenced this pull request Apr 8, 2022
* Replace Upload completer grace period logic with session tracker checking to accurately determine whether an upload has been abandoned

* Update session tracker expiration to be 1 hour, and dynamically extend it while the session is active.
Joerger added a commit that referenced this pull request Apr 11, 2022
* Replace session upload grace period with session tracker (#11551)

* Replace Upload completer grace period logic with session tracker checking to accurately determine whether an upload has been abandoned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit-log Issues related to Teleports Audit Log backport-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Session upload completer grace period bug
3 participants