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

Encode/Decode error for nonode@nohost PIDs #10

Closed
point opened this issue Sep 27, 2018 · 3 comments
Closed

Encode/Decode error for nonode@nohost PIDs #10

point opened this issue Sep 27, 2018 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@point
Copy link

point commented Sep 27, 2018

It seems encon doesn't survive while decoding->encoding+serializing PIDs in format of #PID<0.639.0>

Exception:

io.appulse.encon.terms.exception.IllegalErlangTermTypeException: Class io.appulse.encon.ter
ms.type.ErlangAtom doesn't fit to term type ATOM

Steps to reproduce:

  1. In Elixir: File.write!("pid.term", :erlang.term_to_binary(self))
  2. On Java side:
    Read the first byte of "pid.term" file (it's 131)
  3. Read the rest into ByteBuf
  4. Decode bytebuf into proper java class with ErlangTerm/newInstance
  5. Encode/serialize it to another ByteBuf. Get the error above.

I suspect that the atom for node name of such PID constructs with incorrect value field:

#object[io.appulse.encon.terms.type.ErlangAtom 0x1c433450 "ErlangAtom(value=nu
ll, bytes=[110, 111, 110, 111, 100, 101, 64, 110, 111, 104, 111, 115, 116], ch
arset=ISO-8859-1)"]
@xxlabaza xxlabaza added the bug Something isn't working label Sep 27, 2018
@xxlabaza xxlabaza self-assigned this Sep 27, 2018
@xxlabaza
Copy link
Contributor

@point thanks for your issue, it will be fixed ASAP.

@xxlabaza
Copy link
Contributor

k, I have fixed it.

The new version is available at the master branch and now, Travis, builds release 1.6.5 with that quick fix, after a few hours it will be available at Maven Central, and you can use it in your project.

The cause of the exception was - missing ATOM and SMALL_ATOM serialization cases, you can see it here.

Thanks again for the time which you spent on writing the issue and I hope you will enjoy working with my lib =)

@point
Copy link
Author

point commented Sep 28, 2018

Caught up 1.6.5 from maven central. Now everything works great!
Thanks a lot!

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