From 999fef2426efa3d8b46edbae8c17db61cf383d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Tue, 16 Aug 2022 09:33:46 +0000 Subject: [PATCH] Disable cache (#3152) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * disable storage provider stat cache Signed-off-by: Jörn Friedrich Dreyer * add changelog Signed-off-by: Jörn Friedrich Dreyer * only disable caching 404 Signed-off-by: Jörn Friedrich Dreyer * update changelog Signed-off-by: Jörn Friedrich Dreyer * readd changelog Signed-off-by: Jörn Friedrich Dreyer Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/disable-404-caching.md | 6 ++++++ internal/grpc/services/gateway/storageprovidercache.go | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/disable-404-caching.md diff --git a/changelog/unreleased/disable-404-caching.md b/changelog/unreleased/disable-404-caching.md new file mode 100644 index 0000000000..b1fea1ef23 --- /dev/null +++ b/changelog/unreleased/disable-404-caching.md @@ -0,0 +1,6 @@ +Bugfix: Disable caching of not found stat responses + +We no longer cache not found responses to prevent concurrent requests interfering with put requests. + +https://github.com/cs3org/reva/pull/3152 +https://github.com/owncloud/ocis/issues/4251 diff --git a/internal/grpc/services/gateway/storageprovidercache.go b/internal/grpc/services/gateway/storageprovidercache.go index 76e121fbd6..5367d505aa 100644 --- a/internal/grpc/services/gateway/storageprovidercache.go +++ b/internal/grpc/services/gateway/storageprovidercache.go @@ -270,7 +270,7 @@ func (c *cachedAPIClient) Stat(ctx context.Context, in *provider.StatRequest, op switch { case err != nil: return nil, err - case resp.Status.Code != rpc.Code_CODE_OK && resp.Status.Code != rpc.Code_CODE_NOT_FOUND: + case resp.Status.Code != rpc.Code_CODE_OK: return resp, nil case key == "": return resp, nil