Skip to content

Retry the finalizer loop when the ws-daemon pod not found#11563

Merged
roboquat merged 1 commit into
mainfrom
jenting/connect-to-ws-daemon-when-needed
Jul 26, 2022
Merged

Retry the finalizer loop when the ws-daemon pod not found#11563
roboquat merged 1 commit into
mainfrom
jenting/connect-to-ws-daemon-when-needed

Conversation

@jenting

@jenting jenting commented Jul 22, 2022

Copy link
Copy Markdown
Contributor

Description

Retry the function doFinalize when the ws-daemon pod is not found so that we can reach the condition

if (err != nil && strings.Contains(err.Error(), context.DeadlineExceeded.Error())) ||
st.Code() == codes.Unavailable ||
st.Code() == codes.Canceled {
// service is currently unavailable or we did not finish in time - let's wait some time and try again
time.Sleep(wsdaemonRetryInterval)
continue
}

Related Issue(s)

Fixes #10682

How to test

  1. Create a workspace.
  2. Create a large file.
     dd if=/dev/urandom of=4G bs=16M count=256
  3. Stop the workspace Gitpod: stop workspace and immediately go to step 5.
  4. During the workspace stopping, keep deleting the ws-daemon pod for at least 1 minute. Note, we probably would hit the issue Restart the ws-daemon cause the workspace pod sometimes Failed #11606, but we'd like to tackle it in separate PR.
    while true; do kubectl delete pod -l component=ws-daemon; done
  5. Cancel step 5 (ctrl+c).
  6. Check the workspace changes to the stopped state and the backup content persistent.

Release Notes

None

Documentation

None

Werft options:

  • /werft with-preview

@jenting
jenting force-pushed the jenting/connect-to-ws-daemon-when-needed branch from 918e24d to f202131 Compare July 22, 2022 15:23
@jenting jenting changed the title Retry ws-daemon if not found within 2 mins Retry the finalizer loop when the ws-daemon pod not found Jul 22, 2022
@jenting
jenting force-pushed the jenting/connect-to-ws-daemon-when-needed branch from f202131 to 5124134 Compare July 22, 2022 16:17
@roboquat roboquat added size/M and removed size/S labels Jul 22, 2022
@jenting
jenting force-pushed the jenting/connect-to-ws-daemon-when-needed branch from 5124134 to 3c110b5 Compare July 22, 2022 16:39
@roboquat roboquat added size/S and removed size/M labels Jul 22, 2022
@jenting
jenting force-pushed the jenting/connect-to-ws-daemon-when-needed branch 2 times, most recently from be8e5f1 to 30dfd0f Compare July 22, 2022 23:00
Signed-off-by: JenTing Hsiao <hsiaoairplane@gmail.com>
@jenting
jenting force-pushed the jenting/connect-to-ws-daemon-when-needed branch from 30dfd0f to 444ccf0 Compare July 25, 2022 01:53
@jenting
jenting marked this pull request as ready for review July 25, 2022 03:22
@jenting
jenting requested a review from a team July 25, 2022 03:22
@github-actions github-actions Bot added the team: workspace Issue belongs to the Workspace team label Jul 25, 2022
Comment thread components/ws-manager/pkg/manager/monitor.go
@jenting
jenting requested a review from utam0k July 26, 2022 02:02
@roboquat
roboquat merged commit a476781 into main Jul 26, 2022
@roboquat
roboquat deleted the jenting/connect-to-ws-daemon-when-needed branch July 26, 2022 02:23
@roboquat roboquat added deployed: workspace Workspace team change is running in production deployed Change is completely running in production labels Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployed: workspace Workspace team change is running in production deployed Change is completely running in production release-note-none size/S team: workspace Issue belongs to the Workspace team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ws-manager] "last backup failed: no running ws-daemon pod found."

3 participants