Skip to content

Fix incorrect state when hostname resolution fails#96

Merged
arkgil merged 1 commit into
beam-telemetry:mainfrom
juanperi:fix/hostname-resolution-error-leads-to-incorrect-state
Jun 2, 2024
Merged

Fix incorrect state when hostname resolution fails#96
arkgil merged 1 commit into
beam-telemetry:mainfrom
juanperi:fix/hostname-resolution-error-leads-to-incorrect-state

Conversation

@juanperi

Copy link
Copy Markdown
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
Copy Markdown
Contributor

👍

@sunnybit

Copy link
Copy Markdown
Contributor

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

@arkgil

arkgil commented Jun 2, 2024

Copy link
Copy Markdown
Collaborator

Thanks!

@arkgil arkgil merged commit 7820775 into beam-telemetry:main Jun 2, 2024
@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