-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support OTP 28 #5507
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
Support OTP 28 #5507
Conversation
Update: fixed. My local testing box (macOS 16.4.1/latest, arm64) with OTP-28-rc3 makes this test fail:
In the logs, the expected-to-fail request shows a 201:
The relevant test bits are just:
I couldn’t find anything obvious in our or the OTP commits that could cause this. The test passes with OTP-25 and -27 and -28-rc2. |
Next, Mango: The PCRE2 upgrade notes state:
This seems to include
This change to mango_util fixes the issues, but now we are not caching the compiled re: cached_re(Name, RE) ->
- case mochiglobal:get(Name) of
- undefined ->
- {ok, MP} = re:compile(RE),
- ok = mochiglobal:put(Name, MP),
- MP;
- MP ->
- MP
- end.
+ {ok, MP} = re:compile(RE),
+ MP. |
And then still in Mango, we get this a couple of times, seems we expect a reversal of some sort that is no longer happening. I haven’t had time to dig into this, The issue is that sets version 1: Erlang/OTP 27 [erts-15.2.3] [source] [64-bit] [smp:14:14] [ds:14:14:10] [async-threads:1] [jit]
Eshell V15.2.3 (press Ctrl+G to abort, type help(). for help)
1> A = sets:from_list(["a","b", "c"]).
{set,3,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
{{[],
["b"],
[],[],[],[],
["c"],
[],[],[],[],[],
["a"],
[],[],[]}}}
2> B = sets:from_list(["b"]).
{set,1,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]},
{{[],["b"],[],[],[],[],[],[],[],[],[],[],[],[],[],[]}}}
3> sets:to_list(sets:subtract(A, B)).
["c","a"] sets version 2: Erlang/OTP 27 [erts-15.2.3] [source] [64-bit] [smp:14:14] [ds:14:14:10] [async-threads:1] [jit]
Eshell V15.2.3 (press Ctrl+G to abort, type help(). for help)
1> A = sets:from_list(["a","b", "c"], [{version, 2}]).
#{"a" => [],"b" => [],"c" => []}
2> B = sets:from_list(["b"], [{version, 2}]).
#{"b" => []}
3> sets:to_list(sets:subtract(A, B)).
["a","c"] I pushed a quick fix that helps us pass the tests, but we might have to revisit, if we accidentally rely on the representation elsewhere.
|
src/mango/src/mango_cursor.erl
Outdated
expect_set_from_list_ordered(L) -> | ||
case erlang:system_info(otp_release) of | ||
N when N >= "28" -> lists:sort(L); | ||
_ -> L | ||
end. | ||
|
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.
Instead of hard-coding OTP 28 checks in the test, the test should be improved to check that either the sets match or the the sorted lists of expected vs actual unindexable_fields
match.
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.
I gave it a try here #5510. It's a general improvement regardless of OTP version that just make us use all new sets and sorts the results to they are deterministic, otherwise tests might fail randomly again in the future
With OTP 28 sets switchd to using version 2 by default. That caused various tests to fail, as Jan discovered in #5507 In the previous PR #5510 we switched few mango instances to use a helper utility, but it was repeated a few times and Gábor made a good suggestion to use utility functions instead, so that's what this PR does. But it does it for the whole code base. Once we're post OTP 28 we can remove the utility and just use plain set functions.
With OTP 28 sets switchd to using version 2 by default. That caused various tests to fail, as Jan discovered in #5507 In the previous PR #5510 we switched few mango instances to use a helper utility, but it was repeated a few times and Gábor made a good suggestion to use utility functions instead, so that's what this PR does. But it does it for the whole code base. Once we're post OTP 28 we can remove the utility and just use plain set functions.
With OTP 28 sets switchd to using version 2 by default. That caused various tests to fail, as Jan discovered in #5507 In the previous PR #5510 we switched few mango instances to use a helper utility, but it was repeated a few times and Gábor made a good suggestion to use utility functions instead, so that's what this PR does. But it does it for the whole code base. Once we're post OTP 28 we can remove the utility and just use plain set functions.
cleaned up the WIP work that @nickva has been properly fixing in the referenced commit. This should be ready to go now. |
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.
Nice work together! +1
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.
+1 as well for a good team effort!
I see the elixir error only, same one found by Jan
00:43:38.923 [error] beam/beam_load.c(594): Error loading function 'Elixir.Hex.State':print_invalid_config_error/2: op bs_add p x x u x:
please re-compile this module with an Erlang/OTP 28 compiler or update your Erlang/OTP version
That seems to be tracked in elixir-lang/elixir#14349
So it seems we'll just need to wait for OTP 28 to be released and the hex issue fixed to be able to add OTP 28 proper to the CI and build chain.
based on -rc3
c.f. erlang/otp#9739