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

ErlangPid.cached weak hash funciton #13

Closed
point opened this issue Oct 5, 2018 · 2 comments
Closed

ErlangPid.cached weak hash funciton #13

point opened this issue Oct 5, 2018 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@point
Copy link

point commented Oct 5, 2018

Starting from some point, the encon library decodes PID's incorrectly and returns previously cached PID instead of creating the new one:

"ENCON GOT: [\"#PID<0.671.0>\"]
while
JInterface got: #Pid<nonode@nohost.896.0>

896 is the right id of a PID that was sent from Elixir side.

Could you also ditch the caching function while creating atom return (T) ErlangAtom.cached(type, buffer) in ErlangTerm newInstance function? Just in case.

@xxlabaza xxlabaza added the bug Something isn't working label Oct 5, 2018
@xxlabaza xxlabaza self-assigned this Oct 5, 2018
@xxlabaza
Copy link
Contributor

xxlabaza commented Oct 7, 2018

Hi,

It was a premature optimization to make the caches for ErlangPid, ErlangAtom instances. Moreover, it wasn't tested well, and the approach was too naive.

Right now I removed ErlangPid and ErlangAtom caches at all. A new release 1.6.7 was built, published and will be available in few hours at maven central.

In the next major release, I am going to use atom cache reference index at distribution header.

Thanks a lot for your help, @point

@xxlabaza xxlabaza closed this as completed Oct 7, 2018
@point
Copy link
Author

point commented Oct 8, 2018

@xxlabaza Thanks for the fix. Now everything works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants