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

fix(elixir-client): link request & monitor so client never stalls #2096

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

icehaunter
Copy link
Contributor

No description provided.

@icehaunter icehaunter requested a review from magnetised December 4, 2024 09:24
Copy link
Contributor

@magnetised magnetised left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd have gone with a monitor but this works. Have concerns around the global timeout though.

@@ -37,6 +37,10 @@ defmodule Electric.Client.Fetch.Monitor do
def wait(ref) do
receive do
{:response, ^ref, response} -> response
after
60_000 ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I worry about a global timeout because the connection may be receiving a large chunk of data successfully, but slowly. I think with the process linking we should handle any errors and I'd prefer timeouts to be handled by the HTTP client, which is aware of what's happening on the connection (e.g. the difference between a slow download and a broken, unresponsive, connection)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, sounds good. We do know that the response process died, so that should be alright

@icehaunter icehaunter force-pushed the ilia/fix-stuck-elixir-client branch from 033c216 to 8cf8cbb Compare December 4, 2024 09:44
@icehaunter icehaunter requested a review from magnetised December 4, 2024 09:45
Copy link
Contributor

@magnetised magnetised left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely

@icehaunter icehaunter force-pushed the ilia/fix-stuck-elixir-client branch from 8cf8cbb to b3a8434 Compare December 4, 2024 09:52
@icehaunter icehaunter merged commit 6d9b73b into main Dec 4, 2024
25 of 26 checks passed
@icehaunter icehaunter deleted the ilia/fix-stuck-elixir-client branch December 4, 2024 09:56
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.

3 participants