git-sync icon indicating copy to clipboard operation
git-sync copied to clipboard

submodule update failing intermittently when there are new changes

Open anmol opened this issue 6 years ago • 3 comments

I am using git-sync for a repo with submodules. The flow is as follows -

  1. Push code to subrepo(branch b1)
  2. CI runs git submodule update --init --remote --recursive to update the remote.
  3. This causes git-sync to run submodule update.

I see intermittent failures in the submodule update after pushing the changes. When I restart the deployments I don't get errors anymore. I am using v3.1.5

{
    "log": "I0827 09:56:37.466631      17 main.go:529]  \"level\"=0 \"msg\"=\"updating submodules\"  \n",
    "stream": "stderr",
    "docker": {
        "container_id": "cccc"
    },
    "kubernetes": {
        "container_name": "git-sync-clone",
        "namespace_name": "yyyy",
        "pod_name": "xxxx",
        "pod_id": "zzzz",
        "namespace_id": "aaaa",
        "namespace_labels": {
            "istio-injection": "disabled",
            "product_domain": "dd",
            "service_name": "ss",
            "fluxcd_io/sync-gc-mark": "sha256..."
        }
    }
}
{
    "log": "panic: failed to wait4(): no child processes\n\n\n",
...
}
{
    "log": "goroutine 21 [running]:\n",
...
}
{
    "log": "k8s.io/git-sync/pkg/pid1.sigchld()\n\t/src/pkg/pid1/pid1.go:54 +0xfc\n",
...
}
{
    "log": "k8s.io/git-sync/pkg/pid1.runInit(0x11)\n\t/src/pkg/pid1/pid1.go:39 +0xd8\n",
...
}
{
    "log": "created by k8s.io/git-sync/pkg/pid1.ReRun\n\t/src/pkg/pid1/pid1.go:28 +0x170\n",
...
}

We have recently moved to submodules to meet a requirement and didn't face it before.

Bit more context around the deployments: [Maybe not relevant to this issue] I am using it for running Apache Airflow DAGs and using KubernetesExecutor which would launch a worker pod(task + git-sync container) for each task. The errors are specifically observed when some of the tasks are launch after we push some code change on the DAGs subrepo. Restarting the deployments fixes these.

anmol avatar Sep 07 '20 10:09 anmol

Does this also happen, when running git-sync locally?

stp-ip avatar Oct 06 '20 14:10 stp-ip

I tried with v3.1.6 and I have not observed errors since on testing locally. Plan to update the version in our other environments soon.

anmol avatar Oct 07 '20 09:10 anmol

Ok great. Closing this as resolved for now. If it comes up again, let us know. Happy syncing ;)

stp-ip avatar Oct 07 '20 09:10 stp-ip