ityonemo

ityonemo

Getting zombies with erlexec

Hi! I’m still getting zombie processes with erlexec and nothing that I do seems to be able to resolve this. Firstly, i’m on linux. Secondly, i can’t use muontrap, since I need to stream input and output into the other process.

Here’s the code:

  #... Genserver Headers
  def init(_) do
    :erlexec.run_link("priv/forever.sh", [:stderr, :stdout, :kill_group])
    #...

forever.sh

#!/bin/bash

while true; do
  sleep 1
end

Control-c/a definitely creates a zombie (I think the GenServer doesn’t even get the stop message), and even System.stop(0) creates a zombie.

I’m free to put anything in the top of the forever script, so if I can use that to, maybe set the process group or a job, I can definitely do that, but I’m not familiar enough with linux to know if that makes sense. thanks

Thanks in advance.

Most Liked

akash-akya

akash-akya

There is no clean way to do it without using middleware if you are consuming stdin. You need another OS process which act like monitor and do the cleanup. mountrap & ExCmd are such middlewere, but mountrap does not support communicating with the external process and ex_cmd does.

Also If you are streaming a lot of data in/out of beam then it can lead to memory issue. ex_cmd also solves that. See memory issue mentioned here

lud

lud

Not sure if rambo could help there as I think it does the same thing as muontrap, but maybe worth checking.

LostKobrakai

LostKobrakai

You can also take look at ex_cmd.

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
makeitrein
Hey all, just started picking up Elixir last week and am writing a scraper as a learning project. Baby step #1 is extracting the number ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30048 115
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement