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

Track caller on proxy checkin #190

Merged
merged 3 commits into from Feb 25, 2019
Merged

Track caller on proxy checkin #190

merged 3 commits into from Feb 25, 2019

Conversation

josevalim
Copy link
Member

No description provided.

lib/db_connection/ownership/manager.ex Outdated Show resolved Hide resolved
@@ -36,7 +36,7 @@ defmodule DBConnection.Ownership.Proxy do

state = %{client: nil, timer: nil, holder: nil,
timeout: timeout, interval: interval, poll: nil,
owner_ref: owner_ref, pool: pool, pool_ref: nil,
owner: {caller, owner_ref}, pool: pool, pool_ref: nil,
Copy link
Member

Choose a reason for hiding this comment

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

This could be another entry in the map because this data never changes. client has a tuple to ensure "atomicity" so that we always set the whole client status and should be less likely to make a mistake. For owner/owner ref we never check both at same time so code would be clearer without the tuple.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, but I also thought that if we were ever to change it, keeping them as a tuple guarantee we won't make stuff inconsistent.

But I am indifferent. If you have a strong preference for one or another please let me know and I will change it.

@josevalim
Copy link
Member Author

I think we should also include which code the caller is running. It will make debugging much easier.

@josevalim
Copy link
Member Author

Just pushed caller stacktrace as well.

@josevalim josevalim merged commit 1d1e643 into master Feb 25, 2019
@josevalim
Copy link
Member Author

❤️ 💚 💙 💛 💜

@josevalim josevalim deleted the jv-track-caller-proxy branch February 25, 2019 20:21
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

2 participants