I first want to thank José Valim and James Fish for giving me guidance and making something really cool out of a simple idea.

I’ve programmed in a lot of different programming languages, so I can usually read source code well and understand it’s meaning. I would call myself an advanced user of Elixir and maybe an intermediate user of OTP :)

I was first inspired to look into this when I looked at this bug #4004

It looked like an interesting problem. I’m going to describe the process I used to solve it. I had used Poolboy before to make a request pool so I wouldn’t overload the service I was using, so I knew that I at least had a basic enough understanding so I could hopefully implement it.

It’s very common thing among programmer to do this kind of analysis to trace problems and generally check if things are sound and there a no loops in the program. But for everyone that isn’t familiar I’m going to go through this step by step. Use the links to jump into the source code to look for yourself.

First thing was to read the Erlang source code to figure out what is actually happening when you use the Logger.

First stop was of course :io, where it I saw I had to find out how it get’s the group_leader(), which I ended up just running the command on the iex to get the pid and used :observer.start to get the process.

Which was a :group process, you can see it by double clicking on it. Next I checked back with :io on what request it was sending. Then I found the corresponding receiver. But the :group process is given the it’s drv when it initiated. But since I already used :observer so I knew that the :user_drv had created it.

So armed with that knowledge I looked back in the :group so I could know what to look for in :user_drv. I also found that :user_drv was the final stop since it wrote directly to a Port.

So what I found out is that the output to the console was controlled by a GenServer so that the polling concept wouldn’t help because the design of the GenServer already has a mailbox that can handle when you send too many messages, of course not that many so you fill up the mailbox. And it was a single instance, so having multiple instances calling it wouldn’t help.

I suggested we would call it directly and that buffering might work since it decreases the amount of messages that you send, but it also has the possible problem of bufferbloat.

Next time we will go over how I wrote tests for the concept of sending things directly to the :group server for :user_drv.