immich-app / immich

High performance self-hosted photo and video management solution.
https://immich.app
GNU Affero General Public License v3.0
45.17k stars 2.19k forks source link

Immich Android spams server endpoint even if it's down #12706

Open szmarczak opened 5 days ago

szmarczak commented 5 days ago

The bug

  1. Enable network speed icon in the notification bar on Android.
  2. Set up Immich server.
  3. Configure Immich on Android.
  4. Record a video so long that it will take a while to upload.
  5. Take the server down.
  6. It still consumes lots (in my case, the entire 5 MB/s I have) of bandwidth.
  7. Restart the app when the server is down and the same happens. It starts using lots of bandwidth even the server is down.

The OS that Immich Server is running on

N/A

Version of Immich Server

N/A

Version of Immich Mobile App

1.114.0

Platform with the issue

Your docker-compose.yml content

N/A

Your .env content

N/A

Reproduction steps

Above.

Relevant log output

No response

Additional information

No response

szmarczak commented 5 days ago

By "down" I mean gateway error, for example the proxy server failed to connect to host. CloudFlare is one of them.

szmarczak commented 5 days ago

I believe either it's ignoring the status code if the server returns it before reading the request, or it loops.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100#put_request_with_100_continue

bo0tzz commented 5 days ago

Thanks for the report! Proper request backoffs is something that we should really add, yes.

szmarczak commented 5 days ago

I wouldn't mind retries as often as 1 second if it performed a health check first (I guess a minute or a few would work too but anything greater than 5 minutes would be an overkill). This way the bandwidth would be greatly reduced.