-
Notifications
You must be signed in to change notification settings - Fork 3.9k
OTP-20 compatibility workaround for queue directory names. 3.6 only! #1246
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
Conversation
OTP-20 has different binary format for atoms (since OTP-14337) So term_to_binary generates different value. testm_to_binary_compat now have a function to generate a binary identical to pre-20 versions.
|
||
-export([queue_name_to_binary/1]). | ||
|
||
queue_name_to_binary(#resource{kind = queue} = {resource, VHost, queue, Name}) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use #resource
here to make things a bit more forward-compatible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It cannot and should not be forward-compatible.
The function is a workaround and in 3.7 we should get rid of it. The code assumes that the record will be a tuple of this specific format. The match asserts that we haven't changed the record and the function still makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
src/term_to_binary_compat.erl
Outdated
queue_name_to_binary(#resource{kind = queue} = {resource, VHost, queue, Name}) -> | ||
VHostBSize = byte_size(VHost), | ||
NameBSize = byte_size(Name), | ||
<<131, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You floated a version of this with comments next to each byte on Slack. I found them very useful.
I'm getting the following test failures (on 19.3):
|
Fixed tests, which were using strings instead of binaries for queue names. |
Workaround for #1243 for 3.6
OTP-20 has different binary format for atoms (since OTP-14337)
So term_to_binary generates different value.
testm_to_binary_compat now have a function to generate a binary
identical to pre-20 versions.
Does not address management or stomp issues.