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

[supervisor] Improve git status calls to disable optional locks #20715

Merged
merged 1 commit into from
Apr 2, 2025

Conversation

mustard-mh
Copy link
Contributor

@mustard-mh mustard-mh commented Mar 28, 2025

Description

Add GIT_OPTIONAL_LOCKS to supervisor git status, to prevent it creates index.lock

       --no-optional-locks
           Do not perform optional operations that require locks. This is equivalent to setting the GIT_OPTIONAL_LOCKS
           to 0.

       GIT_OPTIONAL_LOCKS
           If this Boolean environment variable is set to false, Git will complete any
           requested operation without performing any optional sub-operations that
           require taking a lock. For example, this will prevent git status from
           refreshing the index as a side effect. This is useful for processes running
           in the background which do not want to cause lock contention with other
           operations on the repository. Defaults to 1.

Related Issue(s)

Relates CLC-1235

How to test

  1. Start a workspace in preview env
  2. It should be able to report git status changes
  3. Watch .git folder, there should have no index.lock file generated every 5 seconds

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

@roboquat roboquat added size/S and removed size/M labels Apr 2, 2025
@mustard-mh mustard-mh changed the title WIP: DEBUG [supervisor] Improve git status calls to disable optional locks Apr 2, 2025
Copy link
Contributor

@iQQBot iQQBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image image

Tested I can still see git status in dashboard, and I also use inotifywait to monitor the file changes to make sure there is no index.lock create/delete periodically (only one, because I manual run git status)

@roboquat roboquat merged commit ea188a5 into main Apr 2, 2025
22 checks passed
@roboquat roboquat deleted the hw/vsc-hanging branch April 2, 2025 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants