Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Removed global filestore flush #3492

Merged
merged 1 commit into from
May 18, 2024
Merged

Bugfix: Removed global filestore flush #3492

merged 1 commit into from
May 18, 2024

Conversation

scudette
Copy link
Contributor

The memcache filestore delays writes in order to batch them. This can cause race conditions in some cases. In particular when creating a download export zip, the GUI tries to access the file immediately. However if the writes are still in flight then it will not be able to find it.

Previously this order was ensured by using FlushFilestore which is a global flush of all inflight writes. However, for memcache filestore on EFS this global flush is a performance killer since the filestore is locked for the duration of the flush. This appears as a deadlock where the entire process is blocked while an export is underway.

This PR improves things in a number of ways:

  1. The flushes are gone in the background - ensuring the filestore is not locked too long.

  2. We avoid calling the global FlushFilestore by installing appropriate completion functions in the export functions.

  3. The TTL cache is updated to allow for overriding the expiry behavior. This makes it simpler to avoid expiring files that are still open.

Also this PR fixes a GUI issue where JSON parsing raises an exception for invalid data. Now the GUI handles it with a suitable default object.

The memcache filestore delays writes in order to batch them. This can
cause race conditions in some cases. In particular when creating a
download export zip, the GUI tries to access the file
immediately. However if the writes are still in flight then it will
not be able to find it.

Previously this order was ensured by using FlushFilestore which is a
global flush of all inflight writes. However, for memcache filestore
on EFS this global flush is a performance killer since the filestore
is locked for the duration of the flush. This appears as a deadlock
where the entire process is blocked while an export is underway.

This PR improves things in a number of ways:
1. The flushes are gone in the background - ensuring the filestore is
   not locked too long.

2. We avoid calling the global FlushFilestore by installing
   appropriate completion functions in the export functions.

3. The TTL cache is updated to allow for overriding the expiry
   behavior. This makes it simpler to avoid expiring files that are
   still open.

Also this PR fixes a GUI issue where JSON parsing raises an exception
for invalid data. Now the GUI handles it with a suitable default
object.
@scudette scudette merged commit d1cc266 into master May 18, 2024
3 checks passed
@scudette scudette deleted the memcache branch May 18, 2024 01:33
scudette added a commit that referenced this pull request May 21, 2024
The memcache filestore delays writes in order to batch them. This can
cause race conditions in some cases. In particular when creating a
download export zip, the GUI tries to access the file immediately.
However if the writes are still in flight then it will not be able to
find it.

Previously this order was ensured by using FlushFilestore which is a
global flush of all inflight writes. However, for memcache filestore on
EFS this global flush is a performance killer since the filestore is
locked for the duration of the flush. This appears as a deadlock where
the entire process is blocked while an export is underway.

This PR improves things in a number of ways:
1. The flushes are gone in the background - ensuring the filestore is
not locked too long.

2. We avoid calling the global FlushFilestore by installing appropriate
completion functions in the export functions.

3. The TTL cache is updated to allow for overriding the expiry behavior.
This makes it simpler to avoid expiring files that are still open.

Also this PR fixes a GUI issue where JSON parsing raises an exception
for invalid data. Now the GUI handles it with a suitable default object.
scudette added a commit that referenced this pull request May 21, 2024
The memcache filestore delays writes in order to batch them. This can
cause race conditions in some cases. In particular when creating a
download export zip, the GUI tries to access the file immediately.
However if the writes are still in flight then it will not be able to
find it.

Previously this order was ensured by using FlushFilestore which is a
global flush of all inflight writes. However, for memcache filestore on
EFS this global flush is a performance killer since the filestore is
locked for the duration of the flush. This appears as a deadlock where
the entire process is blocked while an export is underway.

This PR improves things in a number of ways:
1. The flushes are gone in the background - ensuring the filestore is
not locked too long.

2. We avoid calling the global FlushFilestore by installing appropriate
completion functions in the export functions.

3. The TTL cache is updated to allow for overriding the expiry behavior.
This makes it simpler to avoid expiring files that are still open.

Also this PR fixes a GUI issue where JSON parsing raises an exception
for invalid data. Now the GUI handles it with a suitable default object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant