1kevinxu1

1kevinxu1

I have an app that consumes events from a websocket feed. It calls Registry.dispatch/3 to send messages to subscribed genservers, which then in turn prints them to console. The pipelining is handled by genstage. A producer sits on the socket and generates events with receive calls. The consumer then manages a state and dispatches events to processes in a registry if the state is affected in a specific way. The processes subscribed to the registry would log the event when they receive a message via handle_info/2.

After running the app for ~ 20 minutes, the events stop getting logged to the console without anything happening. In the console, I looked at the registry process and saw the processes had unsubscribed as there were no associated registries with that key, but no errors were thrown and everything happened silently. I also was still getting events so the genstage consumer was still consuming events, and its breaking at the registry dispatching point. I can verify the websocket connection did not close, and events were still being read.

This is a replicable issue. The events stop being printed after about the same delay on each run, which is perplexing. That would make me think there’s a leak of some sort somewhere, but the load graphs on the observer seem to indicate that all is fine. Could it be that the registry is getting overloaded? Maybe it’s being tasked to dispatch too many events and can’t send them fast enough, and eventually the process mailbox overflows?

Showing Posts 1 to 5

OvermindDL1

OvermindDL1

Ooo, I’ve not run across this and I run registry in long-running servers… Any way you could make a short self contained example that we can git clone ... and mix deps.get && mix run to see the issue at hand, even if it does take 20 minutes, even better if you find a way to spam it so fast that it dies sooner? :slight_smile:

dom

dom

Do you have SASL logs enabled? If not, I’d try turning them on. That will tell you if any surpervised process dies and gets restarted.

1kevinxu1

1kevinxu1 OP

@OvermindDL1

I have not yet. How loaded is your registry? Do you also use it for pubsub? I could try to spin something up.

@dom
I have never heard of SASL logs. After doing some digging on google, I am not sure how to incorporate it into my app. Do you have any resources to help me get it set up for my elixir app? Thanks!

OvermindDL1

OvermindDL1

No? I use PubSub for PubSub, no point using Registry there as it has it’s own named registry. ^.^

You just enable SASL logging in Elixir’s Logger, all documented at: Logger — Logger v1.20.2

In essence:

config :logger,
  handle_otp_reports: true,
  handle_sasl_reports: true
dom

dom

Add :sasl to applications or extra_applications in your mix.exs (before :logger, if you have it).

The configuration OvermindDL1 mentioned switches the error report format from Erlang syntax to Elixir syntax, it’s optional.

There’s more background in the SASL user’s guide: SASL Error Logging — OTP 29.0.2 (sasl 4.4)

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews