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

Gun 2.0/master incompatibility #28

Open
michaelklishin opened this issue Apr 1, 2020 · 5 comments
Open

Gun 2.0/master incompatibility #28

michaelklishin opened this issue Apr 1, 2020 · 5 comments

Comments

@michaelklishin
Copy link
Collaborator

This is a heads-up. I accidentally built this plugin in an environment that cloned gun master, and there were exceptions around opening a connections (something about options validation failing, unfortunately I no longer have the logs). We might want to test against Gun 2.0 RCs early.

@lhoguin
Copy link

lhoguin commented May 17, 2021

The difference is that in Gun 1.x the TCP and TLS options are given as a single list (transport_opts), while in 2.0 the lists are separate (tcp_opts and tls_opts).

@enjolras1205
Copy link
Contributor

enjolras1205 commented Aug 12, 2022

i tried to upgrade to gun2.0, is harder than expected.

https://ninenines.eu/docs/en/gun/2.0/guide/migrating_from_1.3/
i found three breaking change:
image

  1. tcp_opts and tls_opts,there will cause a eetcd breaking change too.
  2. use gun:headers to new stream。
    image
diff --git a/src/eetcd_stream.erl b/src/eetcd_stream.erl
index cdcb980..8217521 100644
--- a/src/eetcd_stream.erl
+++ b/src/eetcd_stream.erl
@@ -10,21 +10,21 @@
 -include("eetcd.hrl").
 
 -spec new(Name, Path) -> {ok, GunPid, Http2Ref} when
     Name :: name(),
     Path :: iodata(),
     GunPid :: pid(),
     Http2Ref :: reference().
 new(Name, Path) ->
     case eetcd_conn:round_robin_select(Name) of
         {ok, Pid, Headers} ->
-            Ref = gun:request(Pid, <<"POST">>, Path, Headers, <<>>),
+            Ref = gun:headers(Pid, <<"POST">>, Path, Headers, #{}),
             {ok, Pid, Ref};
  1. eetcd_stream:await/await_body will change to gun:await/await_body。and consider new gun_tunnel_up message.
    image

@michaelklishin
Copy link
Collaborator Author

Thank you for taking the time to investigate.

@zhongwencool
Copy link
Owner

i tried to upgrade to gun2.0, is harder than expected.

https://ninenines.eu/docs/en/gun/2.0/guide/migrating_from_1.3/ i found three breaking change: image

  1. tcp_opts and tls_opts,there will cause a eetcd breaking change too.
  2. use gun:headers to new stream。
    image
diff --git a/src/eetcd_stream.erl b/src/eetcd_stream.erl
index cdcb980..8217521 100644
--- a/src/eetcd_stream.erl
+++ b/src/eetcd_stream.erl
@@ -10,21 +10,21 @@
 -include("eetcd.hrl").
 
 -spec new(Name, Path) -> {ok, GunPid, Http2Ref} when
     Name :: name(),
     Path :: iodata(),
     GunPid :: pid(),
     Http2Ref :: reference().
 new(Name, Path) ->
     case eetcd_conn:round_robin_select(Name) of
         {ok, Pid, Headers} ->
-            Ref = gun:request(Pid, <<"POST">>, Path, Headers, <<>>),
+            Ref = gun:headers(Pid, <<"POST">>, Path, Headers, #{}),
             {ok, Pid, Ref};
  1. eetcd_stream:await/await_body will change to gun:await/await_body。and consider new gun_tunnel_up message.
    image

We'll likely accept a PR(0.4.0) that upgrade to gun 2.0

@enjolras1205
Copy link
Contributor

hope to submit in early October.

HoloRin added a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 15, 2023
now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
mergify bot pushed a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 16, 2023
now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
mergify bot pushed a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 16, 2023
now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)

# Conflicts:
#	deps/rabbitmq_peer_discovery_etcd/BUILD.bazel
HoloRin added a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 17, 2023
now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)
HoloRin added a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 17, 2023
* Regenerate bazel/BUILD.eetcd with the latest rules_erlang

`bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
hex.pm/[email protected]`

Related to #7196

(cherry picked from commit 2dc0236)
(cherry picked from commit 733aad5)

# Conflicts:
#	MODULE.bazel
#	WORKSPACE

* Remove extra erlc_opts from BUILD.eetcd

Should be unnecessary once
rabbitmq/rules_erlang#140 is available in a
release

(cherry picked from commit b6e145c)
(cherry picked from commit d646ea4)

* Update the note about eetcd and dialyzer

now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)

* Adjust the size of //deps/rabbit:bindings_SUITE to medium

generally speaking, rabbitmq_integration_suite tests do not reliably
run in under the 60s timeout implied by "small", at least in CI

(cherry picked from commit 60093ee)
(cherry picked from commit d56f004)

# Conflicts:
#	deps/rabbit/BUILD.bazel

* Add missing dep to //deps/rabbitmq_aws:eunit test

(cherry picked from commit 1bef97a)
(cherry picked from commit 60d09a3)

* Additional conflict resolution

---------

Co-authored-by: Rin Kuryloski <[email protected]>
mergify bot added a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 17, 2023
* Regenerate bazel/BUILD.eetcd with the latest rules_erlang

`bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
hex.pm/[email protected]`

Related to #7196

(cherry picked from commit 2dc0236)
(cherry picked from commit 733aad5)

# Conflicts:
#	MODULE.bazel
#	WORKSPACE

* Remove extra erlc_opts from BUILD.eetcd

Should be unnecessary once
rabbitmq/rules_erlang#140 is available in a
release

(cherry picked from commit b6e145c)
(cherry picked from commit d646ea4)

* Update the note about eetcd and dialyzer

now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)

* Adjust the size of //deps/rabbit:bindings_SUITE to medium

generally speaking, rabbitmq_integration_suite tests do not reliably
run in under the 60s timeout implied by "small", at least in CI

(cherry picked from commit 60093ee)
(cherry picked from commit d56f004)

# Conflicts:
#	deps/rabbit/BUILD.bazel

* Add missing dep to //deps/rabbitmq_aws:eunit test

(cherry picked from commit 1bef97a)
(cherry picked from commit 60d09a3)

* Additional conflict resolution

---------

Co-authored-by: Rin Kuryloski <[email protected]>
(cherry picked from commit 6be0b49)

# Conflicts:
#	deps/rabbitmq_peer_discovery_etcd/BUILD.bazel
HoloRin pushed a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 17, 2023
* Regenerate bazel/BUILD.eetcd with the latest rules_erlang

`bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
hex.pm/[email protected]`

Related to #7196

(cherry picked from commit 2dc0236)
(cherry picked from commit 733aad5)

# Conflicts:
#	MODULE.bazel
#	WORKSPACE

* Remove extra erlc_opts from BUILD.eetcd

Should be unnecessary once
rabbitmq/rules_erlang#140 is available in a
release

(cherry picked from commit b6e145c)
(cherry picked from commit d646ea4)

* Update the note about eetcd and dialyzer

now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)

* Adjust the size of //deps/rabbit:bindings_SUITE to medium

generally speaking, rabbitmq_integration_suite tests do not reliably
run in under the 60s timeout implied by "small", at least in CI

(cherry picked from commit 60093ee)
(cherry picked from commit d56f004)

# Conflicts:
#	deps/rabbit/BUILD.bazel

* Add missing dep to //deps/rabbitmq_aws:eunit test

(cherry picked from commit 1bef97a)
(cherry picked from commit 60d09a3)

* Additional conflict resolution

---------

Co-authored-by: Rin Kuryloski <[email protected]>
(cherry picked from commit 6be0b49)

# Conflicts:
#	deps/rabbitmq_peer_discovery_etcd/BUILD.bazel
HoloRin pushed a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 17, 2023
* Regenerate bazel/BUILD.eetcd with the latest rules_erlang

`bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
hex.pm/[email protected]`

Related to #7196

(cherry picked from commit 2dc0236)
(cherry picked from commit 733aad5)

* Remove extra erlc_opts from BUILD.eetcd

Should be unnecessary once
rabbitmq/rules_erlang#140 is available in a
release

(cherry picked from commit b6e145c)
(cherry picked from commit d646ea4)

* Update the note about eetcd and dialyzer

now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)

* Adjust the size of //deps/rabbit:bindings_SUITE to medium

generally speaking, rabbitmq_integration_suite tests do not reliably
run in under the 60s timeout implied by "small", at least in CI

(cherry picked from commit 60093ee)
(cherry picked from commit d56f004)

* Add missing dep to //deps/rabbitmq_aws:eunit test

(cherry picked from commit 1bef97a)
(cherry picked from commit 60d09a3)

* Additional conflict resolution

---------

Co-authored-by: Rin Kuryloski <[email protected]>
(cherry picked from commit 6be0b49)
HoloRin added a commit to rabbitmq/rabbitmq-server that referenced this issue Feb 17, 2023
#7329) (#7352)

* Use the latest rules_erlang (backport #7315) (backport #7327) (#7329)

* Regenerate bazel/BUILD.eetcd with the latest rules_erlang

`bazel run gazelle -- update-repos --verbose --build_files_dir=bazel
hex.pm/[email protected]`

Related to #7196

(cherry picked from commit 2dc0236)
(cherry picked from commit 733aad5)

* Remove extra erlc_opts from BUILD.eetcd

Should be unnecessary once
rabbitmq/rules_erlang#140 is available in a
release

(cherry picked from commit b6e145c)
(cherry picked from commit d646ea4)

* Update the note about eetcd and dialyzer

now that the original issue has been resolved. We cannot bump gun just
yet, as eetcd is not yet compatible with gun 2.0.0

zhongwencool/eetcd#28
zhongwencool/eetcd#55
(cherry picked from commit 185e910)
(cherry picked from commit 31f5eec)

* Adjust the size of //deps/rabbit:bindings_SUITE to medium

generally speaking, rabbitmq_integration_suite tests do not reliably
run in under the 60s timeout implied by "small", at least in CI

(cherry picked from commit 60093ee)
(cherry picked from commit d56f004)

* Add missing dep to //deps/rabbitmq_aws:eunit test

(cherry picked from commit 1bef97a)
(cherry picked from commit 60d09a3)

* Additional conflict resolution

---------

Co-authored-by: Rin Kuryloski <[email protected]>
(cherry picked from commit 6be0b49)

* thoas -> jsx

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Rin Kuryloski <[email protected]>
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

No branches or pull requests

4 participants