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 incorrect state when hostname resolution fails #96

Conversation

juanperi
Copy link
Contributor

This PR is much less ambitious than #94 (and so I expect it would be an easier merge). In this case, we just fix the issue when the process is already started, but an error in the resolution of the hostname leads to an incorrect internal state.

Without this patch, the new_state will be :ok, as that is the return from the logger function.
Afterwards, when going to the terminate callback, then we try to call EventHandler.detach(state.handler_ids), which translates to EventHandler.detach(:ok.handler_ids) and fails.

This PR is much less ambitious than beam-telemetry#94. In this case, we just fix the
issue when the process is already started, but an error in the
resolution of the hostname leads to an incorrect internal state.

Without this patch, the `new_state` will be `:ok`, as that is the return
from the logger function.
Afterwards, when going to the `terminate` callback, then we try to call
`EventHandler.detach(state.handler_ids)`, which translates to
`EventHandler.detach(:ok.handler_ids)` and fails
@sunnybit
Copy link
Contributor

👍

@sunnybit
Copy link
Contributor

@arkgil could you review this PR, this enables us to move away from forked version of the library

@arkgil
Copy link
Collaborator

arkgil commented Jun 2, 2024

Thanks!

@arkgil arkgil merged commit 7820775 into beam-telemetry:main Jun 2, 2024
9 checks passed
@juanperi juanperi deleted the fix/hostname-resolution-error-leads-to-incorrect-state branch June 3, 2024 08:12
@juanperi juanperi restored the fix/hostname-resolution-error-leads-to-incorrect-state branch June 3, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants