tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.69k stars 303 forks source link

Retryability for live updates on what seems to be a recoverable error #5904

Open krijoh92 opened 2 years ago

krijoh92 commented 2 years ago

Expected Behavior

Live update should retry on recoverable errors, or at least be configurable to do so.

Current Behavior

Currently live update doesn't retry on the following error:

Will copy 1 file(s) to container: [<podname>/path]
- 'path/to/file.tsx' --> '/remote/path/to/file.tsx'
Build Failed: Updating pod <podname>: copying changed files: error dialing backend: EOF
LiveUpdate "name:registry.example.com_stuff_here" UpdateFailed: Updating pod <podname>: copying changed files: error dialing backend: EOF

While I'm still able to exec into the pod, get logs from it and interact with it like any other time. Might just be a hickup in my home-network that causes this, so it stings having to rebuild the image for the service whenever this happens.

Context

tilt doctor Output

-> tilt doctor
Tilt: v0.30.4, built 2022-06-16
System: linux-amd64
---
Docker
- Host: unix:///var/run/docker.sock
- Server Version: 20.10.12
- API Version: 1.41
- Builder: 2
---
Kubernetes
- Env: unknown
- Context: rpi8s
- Cluster Name: rpi8s
- Namespace: ---
- Container Runtime: containerd
- Version: v1.23.8+k3s2
- Cluster Local Registry: none
padzikm commented 2 years ago

I have the same issue - sample repo: https://github.com/padzikm/TiltSample

Output from tilt ui logs:

1 time file changed: Will copy 4 file(s) to container: [hello-tilt-back2-5894c86bb6-82bwg/hello-tilt-back2]

2 time file changed: full image rebuild and redeploy succeeded

3 time file changed: livereload succeeded

4 time file changed: Will copy 4 file(s) to container: [hello-tilt-back2-7955fc4958-v9jpz/hello-tilt-back2]

Oftentimes there is one livereload success and on next file changes error: copying changed files: error dialing backend: EOF Container restarts and especially rebuilding and redeploying is time consuming to watch what failed when working with larger project

tilt doctor: Tilt: v0.30.6, built 2022-08-04 System: darwin-amd64 Docker