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

AMQP Fix #3023 #3025

Merged
merged 3 commits into from
Oct 20, 2023
Merged

AMQP Fix #3023 #3025

merged 3 commits into from
Oct 20, 2023

Conversation

bturos
Copy link
Contributor

@bturos bturos commented Oct 19, 2023

Offer new cached connection when previous one has been closed and released

References #3023

ℹ️ I'm not sure whether abort is the best way to simulate connection closed by the server. Hopefully, for the purpose of unit test, this is good enough

Offer new cached connection when previous one has been closed and released
@bturos bturos changed the title Fix #3023 AMQP Fix #3023 Oct 19, 2023
@ennru
Copy link
Member

ennru commented Oct 19, 2023

Scala 3 tries to apply the tail recursiveness even to provider.get. Moving provider.get into a separate method and calling that to retrieve the connection from the provider should convince the compiler this is OK to do.

[error] -- Error: /home/runner/work/alpakka/alpakka/amqp/src/main/scala/akka/stream/alpakka/amqp/AmqpConnectionProvider.scala:375:27 
[error] 375 |          val connection = provider.get
[error]     |                           ^^^^^^^^^^^^
[error]     |                 Cannot rewrite recursive call: it targets a supertype

Copy link
Member

@ennru ennru left a comment

Choose a reason for hiding this comment

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

Thank you!
LGTM.

It is still draft, do you expect to change something more?

@bturos
Copy link
Contributor Author

bturos commented Oct 19, 2023

Thank you! LGTM.

It is still draft, do you expect to change something more?

Nope, it was just a measure of precaution in case something else pops up. Moving to Open, thank you for reviewing :)

@bturos bturos marked this pull request as ready for review October 19, 2023 18:02
@ennru ennru merged commit a499d43 into akka:main Oct 20, 2023
47 of 48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants