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

Add OTP-24 to CI #273

Merged
merged 5 commits into from
Sep 21, 2021
Merged

Add OTP-24 to CI #273

merged 5 commits into from
Sep 21, 2021

Conversation

seriyps
Copy link
Collaborator

@seriyps seriyps commented Aug 20, 2021

Rebar3 is updated to

$ ./rebar3 --version
rebar 3.15.2 on Erlang/OTP 24 Erts 12.0

(downloaded it from https://github.com/erlang/rebar3/releases/tag/3.15.2)

Have to make some changes in gen_smtp_server_session.erl because on some OTP versions it started to ignore binary option after TLS connection upgrade

@seriyps seriyps force-pushed the otp-24 branch 2 times, most recently from 7efce4c to a974899 Compare August 20, 2021 19:15
@seriyps seriyps requested review from mworrell and arjan August 20, 2021 19:19
- name: Cover
run: make cover
if: "${{ matrix.otp_vsn != '24.0' }}"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I didn't manage to find a better way to use ranch20 profile for OTP-24 and test profile for al lother versions. Any ideas?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could probably be more explicit and add rebar profile to the matrix, so we run all the tests with both ranch versions, but then exclude some unsupported combinations (like ranch 1.7 + OTP-24 ranch 2.0 + OTP<21.3). Maybe no need to run dialyzer on all of the though...
smth like

matrix:
    otp_vsn: [20.3, 21.3, 22.3, 23.3, 24.0]
    profile: [test, ranch20]
    exclude:
      - otp_vsn: 24.0
        profile: test
      - otp_vsn: 20.3
        profile: ranch20
...
steps:
  - name: Test
    run: make test REBAR_PROFILE=${{matrix.profile}}

@@ -709,7 +710,7 @@ handle_request({<<"STARTTLS">>, <<>>}, #state{socket = Socket, module = Module,
case ranch_ssl:handshake(Socket, [{packet, line}, {mode, list}, {ssl_imp, new} | TlsOpts2], 5000) of %XXX: see smtp_socket:?SSL_LISTEN_OPTIONS
{ok, NewSocket} ->
?log(debug, "SSL negotiation sucessful~n"),
ranch_ssl:setopts(NewSocket, [{packet, line}]),
ranch_ssl:setopts(NewSocket, [{packet, line}, binary]),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for some reason, without this change ssl socket started to send lines as strings instead of binaries on OTP-24

Copy link
Collaborator

Choose a reason for hiding this comment

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

That is weird, sounds like a bug in OTP.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes I traced this one down here: erlang/otp#4585

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, so we fixed it for SMTP client, but forgot about the server 😄
But good to know it's not some mystery but actual known OTP issue.

@seriyps seriyps changed the title Add OTP-24, remove OTP-20 to CI Add OTP-24 to CI Aug 23, 2021
@seriyps seriyps mentioned this pull request Sep 3, 2021
@seriyps
Copy link
Collaborator Author

seriyps commented Sep 6, 2021

Hey, @mworrell @arjan . Would you be able to review this when you have time?

Copy link
Contributor

@cw789 cw789 left a comment

Choose a reason for hiding this comment

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

I've tried to review now.
Locally testing the server as described in the README.markdown seems to work fine.
But I can only say it for OTP-24.

runs-on: ${{matrix.os}}

strategy:
matrix:
otp_vsn: [20.3, 21.3, 22.3, 23.1]
otp_vsn: [20.3, 21.3, 22.3, 23.3, 24.0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can drop OTP 20, as rebar3 is only supporting the last three OTP releases.

For this reason we have also removed OTP 20 from the testing matrix in Zotonic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

rebar3 version I'm bundling in this PR 3.15.2 works fine for all versions from 20 to 24. But maybe I'm just lucky. I was jsut thinking that #267 would have to drop OTP-20 (because logger was introduced in OTP-21), so, it can be done there?

os: [ubuntu-latest]
profile: [test, ranch20]
exclude:
- otp_vsn: 24.0 # ranch 1.x does not work on OTP24+
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are using ranch 1.8 with OTP 24.0.5.
I suspect any problems with 1.x and OTP 24 were resolved in 1.8

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah, quite possible 1.8 might work. We just don't have rebar.config profile that enforces 1.8. Do you suggest I should add ranch18 profile and add it to the matrix as well? Or it's fine as it is now?

@mworrell
Copy link
Collaborator

After this is merged we can rebase #267

@seriyps
Copy link
Collaborator Author

seriyps commented Sep 21, 2021

ok, so I removed OTP-20 and also added one more test profile that includes ranch 1.8

@mworrell
Copy link
Collaborator

Looks good!

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.

4 participants