Skip to content

coder tunnel does not update workspace last_used with long-lived connections #12431

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

Closed
ericpaulsen opened this issue Mar 5, 2024 · 7 comments · Fixed by #12659
Closed

coder tunnel does not update workspace last_used with long-lived connections #12431

ericpaulsen opened this issue Mar 5, 2024 · 7 comments · Fixed by #12659
Assignees
Labels
customer-reported Bugs reported by enterprise customers. Only humans may set this. s2 Broken use cases or features (with a workaround). Only humans may set this.

Comments

@ericpaulsen
Copy link
Member

a customer is connecting to their workspace via coder tunnel, and the last_used metric is not being updated. this is across Linux and Windows VMs.

@ericpaulsen ericpaulsen added the bug label Mar 5, 2024
@coder-labeler coder-labeler bot added the customer-reported Bugs reported by enterprise customers. Only humans may set this. label Mar 5, 2024
@ericpaulsen
Copy link
Member Author

this was working in 2.4.0, not working in 2.8.3

@johnstcn johnstcn self-assigned this Mar 15, 2024
@johnstcn johnstcn added the s1 Bugs that break core workflows. Only humans may set this. label Mar 15, 2024
@johnstcn
Copy link
Member

coder port-forward currently only considers new connections as activity; long-lived connections such as websockets will only be counted once.
As a workaround, curling the port-forwarded address periodically (or even just executing a nc -z ) will cause workspace last_used_at to be updated. Downgrading to s2 based on this new information.

@johnstcn johnstcn added s2 Broken use cases or features (with a workaround). Only humans may set this. and removed s1 Bugs that break core workflows. Only humans may set this. labels Mar 15, 2024
@ericpaulsen
Copy link
Member Author

thanks @johnstcn - do you know why this was previously working in 2.4.0?

@johnstcn johnstcn changed the title last_used metric not being bumped by coder tunnel agent does not detect long-lived connections as activity Mar 15, 2024
@johnstcn
Copy link
Member

johnstcn commented Mar 15, 2024

We made changes to how workspace activity was detected between 2.4.0 and 2.5.0 in order to support dormancy. Before, we were considering any network connection to the agent over tailnet as usage -- but that metric can be inaccurate for various reasons.

@johnstcn
Copy link
Member

#12659

@johnstcn johnstcn changed the title agent does not detect long-lived connections as activity coder tunnel does not update workspace last_used with long-lived connections Mar 19, 2024
@johnstcn
Copy link
Member

#12659 modifies the port-forward command to continuously update last_used_at for the respective workspace while it is running.

@johnstcn
Copy link
Member

This issue was a symptom of how we currently perform workspace activity tracking. Filed #12693 to continue the process of standardizing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Bugs reported by enterprise customers. Only humans may set this. s2 Broken use cases or features (with a workaround). Only humans may set this.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants