- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Sessions transfer #5229
base: master
Are you sure you want to change the base?
Sessions transfer #5229
Conversation
17a0173
to
96d1b27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
Files not reviewed (4)
- lib/plausible/application.ex: Language not supported
- lib/plausible/session/persistence.ex: Language not supported
- lib/plausible/session/persistence/tinysock.ex: Language not supported
- lib/plausible_web/controllers/api/system_controller.ex: Language not supported
6ddc0b7
to
e54aff6
Compare
8421233
to
f0ae022
Compare
|
|
defp file_stat_ctime(path) do | ||
case File.stat(path) do | ||
{:ok, stat} -> stat.ctime | ||
{:error, _} -> nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What category of errors result with nil
here? Shouldn't we then filter the path out and log failure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't thought about it much, but the idea was to allow tinysock client to remove stale/broken files in sock_connect_or_rm
and since tuple (normal stat.ctime
) is > nil
, this ordering is like "asc nulls last" so the cleanup happens in the end of the transfer.
@@ -0,0 +1,31 @@ | |||
defmodule Plausible.Session.Transfer.Alive do | |||
@moduledoc false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be beneficial to keep the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to have only one place with the docs, Plausible.Session.Transfer
.
It already briefly explains the role of this "alive" process.
Attempt at transferring in-memory sessions across deployments using shared persistent cache and Unix domain sockets.