itsachen
GenStage - Unexpected :ssl_closed message
Hi!
I have an Elixir application that is ingesting messages from a queue (AWS SQS). It is based off this design that uses GenStage.
The design is as follows:
- GenStage Producer that fetches messages from the queue
- GenStage Consumer that subscribes to Producer, receives the queue message and deletes it from the queue
The application runs smoothly with the exception of a failure that occurs 1-2 times every hour.
It seems that the GenStage Consumer is being sent the following message (which is not accounted for and hence fails):
{:sslsocket, {:gen_tcp, #Port<0.XXXX>, :tls_connection, :undefined}, #PID<0.XXXX.0>}}
I’m racking my brain trying to understand how this might be occurring. There are no explicit messages being sent to the consumer in my application code. The consumers are relatively simple as well - they’re simply using ExAws to make requests to AWS through their API. I don’t make any calls to :gen_tcp at any point.
I’m curious if anybody has encountered something similar or had any ideas about what might be going on.
For context:
Elixir Version:
1.5
Dependencies:
- configparser_ex
- credo
- dialyxir
- distillery
- ex_aws
- excoveralls
- gen_stage
- hackney
- httpoison
- mock
- poison
- sentry
- sshex
- sweet_xml
- timex
Most Liked
josevalim
One idea is to match on the message and use Port.info on the port and Process.info on the pid and then log the results so you can read it later on. That should give you more hints about which process is leaking them.
itsachen
That makes sense. Thanks for the leads!
I’ll continue investigating and will update with any progress made.
minhajuddin
What is your erlang version? Erlang 19 has an issue with broken ssl. I’ve run into a similar issue which was fixed when I used the proper tls version :‘tlsv1.2’ (GitHub - edgurgel/httpoison: Yet Another HTTP client for Elixir powered by hackney · GitHub)
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








