che icon indicating copy to clipboard operation
che copied to clipboard

What does "no activity" in the description of "secondsOfRunBeforeIdling" CR mean?

Open top1436 opened this issue 3 years ago • 4 comments

Summary

In the CR, There is a "devEnvironments.secondsOfRunBeforeIdling" field. It said "Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is "no activity". To disable workspace idling due to inactivity, set this value to -1." and default values is "1800"

I want to know how to check the no activity.

  1. how to check the duration
  • which process checks the duration?
  1. when the no acitivity status is changed
  • how to determine whether it is active or not.

Relevant information

No response

top1436 avatar May 31 '23 01:05 top1436

@tolusha @dmytro-ndp Can anyone answer this for me?

top1436 avatar Jun 16 '23 06:06 top1436

Hello @top1436 , sorry for the delay, I think you're referring to devEnvironments.secondsOfInactivityBeforeIdling instead of devEnvironments.secondsOfRunBeforeIdling is that right?

how to check the duration

To check the inactivity idle duration for the workspace, you can run the following within the workspace:

$ env | grep SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING

SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING=10800

The env variable should be the same as the value in the CR. If the value in the CR is updated with a new idle timeout, the new timeout will be applied on newly started workspaces.

which process checks the duration?

The process that reads this value, and is responsible for terminating idled workspaces is che-machine-exec:

$ ps aux | grep machine-exec

user          19  0.0  0.0 741192 30212 ?        Sl   13:22   0:00 /checode/bin/machine-exec --url 0.0.0.0:3333

when the no acitivity status is changed how to determine whether it is active or not.

Activity is being detected with this built-in extension: https://github.com/che-incubator/che-code/pull/65

To verify that activity is being detected and sent to che-machine-exec, you can run the following to view the activity/tick requests:

$ cat /checode/entrypoint-logs.txt | grep /activity/tick

[GIN] 2023/06/16 - 13:22:33 | 204 |       3.371µs |       127.0.0.1 | POST     /activity/tick
[GIN] 2023/06/16 - 13:23:59 | 204 |       3.621µs |       127.0.0.1 | POST     /activity/tick
[GIN] 2023/06/16 - 13:24:59 | 204 |       2.361µs |       127.0.0.1 | POST     /activity/tick
[GIN] 2023/06/16 - 13:25:59 | 204 |       2.642µs |       127.0.0.1 | POST     /activity/tick

dkwon17 avatar Jun 16 '23 14:06 dkwon17

@dkwon17 Thank you for your explanation.

"devEnvironments.secondsOfInactivityBeforeIdling" is right. my bad..

If che-code built-in extension checks "Activity", Another IDE cannot be applied this option? ex) IntelliJ

In my exprience, Intellij is also applied this option and it stopped Intellij workspace after the seconds.

In IntelliJ, Is it implemented a different way?

top1436 avatar Jun 21 '23 01:06 top1436

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

che-bot avatar Dec 18 '23 01:12 che-bot