ocis icon indicating copy to clipboard operation
ocis copied to clipboard

feat: return Retry-After header in case of 429/Too Many Requests on thumbnail WebDAV endpoint

Open DeepDiver1975 opened this issue 1 year ago • 9 comments

Description

https://github.com/owncloud/ocis/pull/9199#discussion_r1608337168

Related Issue

https://github.com/owncloud/ocis/pull/9199#discussion_r1608337168

Motivation and Context

https://github.com/owncloud/ocis/pull/9199#discussion_r1608337168

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] Technical debt
  • [ ] Tests only (no source changes)

Checklist:

  • [x] Code changes
  • [ ] Unit tests added
  • [ ] Acceptance tests added
  • [ ] Documentation ticket raised:

DeepDiver1975 avatar May 22 '24 15:05 DeepDiver1975

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

update-docs[bot] avatar May 22 '24 15:05 update-docs[bot]

hm, yeah ... determining a retry after timeout is hard. 5min is pretty long ... I'd start with 30sec and use an exponential backoff.

Also, the current Throttle limit is global ... maybe sth like https://github.com/go-chi/httprate with a limit on real ip and endpoint? urg but that requires common state, which is why there is https://github.com/go-chi/httprate-redis

since this is something I expect to be tweakable ... should we just add an env var for this?

butonic avatar May 23 '24 11:05 butonic

Also, the current Throttle limit is global ... maybe sth like https://github.com/go-chi/httprate with a limit on real ip and endpoint? urg but that requires common state, which is why there is https://github.com/go-chi/httprate-redis

But this is more for real rate limiting which could be used for some kind of far usage of the thumbnail service. The existing implementation limits resource consumption of the thumbnail service.

Or am I miss-understanding your comment?

since this is something I expect to be tweakable ... should we just add an env var for this?

Two vars then? One for done and one for not done ....

hm, yeah ... determining a retry after timeout is hard. 5min is pretty long ... I'd start with 30sec and use an exponential backoff.

I didn't want to over-engineer this tbh :see_no_evil:

DeepDiver1975 avatar May 23 '24 11:05 DeepDiver1975

Please finish or close 😄

micbar avatar Jul 09 '24 09:07 micbar

I should have written "finish" 😬

micbar avatar Jul 09 '24 09:07 micbar

@butonic wants it -> please finish

micbar avatar Jul 09 '24 09:07 micbar

Feel free to take over. Thx

DeepDiver1975 avatar Sep 13 '24 20:09 DeepDiver1975

IMO we need this to tell clients to actually retry fetching thumbnails.

butonic avatar Sep 24 '24 09:09 butonic

This has been implemented in https://github.com/owncloud/ocis/pull/10280

micbar avatar Nov 21 '24 07:11 micbar