jeroenbourgois

jeroenbourgois

Hi!

I wonder if somebody could provide me with some insights on the difference between APP/bin/APP start and APP/bin/APP foreground, apart from the obvious (daemon like behaviour vs direct output).

We have some strange behaviour in our app when ran with ‘start’ (from using edeliver) rather than with foreground. More specific, we have some tasks running with Quantum and when using start they are registered and run multiple times (typically twice) and they also use old stale code (an outdated Ecto schema). When starting the app with foreground everything runs fine.

For now we only see this behaviour on our staging server, but since staging and prod are almost identical we are stressing deploying to production.

Showing Posts 1 to 9

lpil

lpil

Creator of Gleam

Could you be running more than one instance of the application at once? You could have the previous version and the current version both running in the background at the same time. This would explain the multiple jobs and the old code. It is easy to lose track of background processes I find :slight_smile:

sasajuric

sasajuric

Author of Elixir In Action

There should not be other differences, so I agree with @lpil that you might have multiple BEAM instances running. Maybe the problem is in the place invoking APP/bin/APP, which somehow doesn’t properly handle the start scenario, where the command returns immediately. Who is starting the release? Are you using e.g. systemd? In such case, IIRC, foreground should be used, not start.

jeroenbourgois

jeroenbourgois OP

Ok found it. There was some rogue old VPS running the app (not really rogue, but that makes my mistake sound less bad :wink: ).

No issue at all!

tristan

tristan

Rebar3 Core Team

While unrelated to your issue here I figured I should include the usual rant about start and the differences from foreground:

start is poorly named. With the new release functionality being added to mix this is luckily fixed, Jose has named it daemon instead of start.

The daemon created by start will fsync on every log line written which can become a bottleneck. Unless you really need the functionality of a pipe you can attach to I advise against ever using it.

Eventually rebar3 and relx will rename it, this hasn’t been done simply for backwards compatibility that goes back to the original rebar reltool scripts. Hopefully distillery will also rename it.

jeroenbourgois

jeroenbourgois OP

Interesting! So it is better to just run releases using foreground?

tristan

tristan

Rebar3 Core Team

Right. Using start should only be when the user discovers they need some of the run_erl functionality http://erlang.org/doc/man/run_erl.html

dynamite-ready

dynamite-ready

I came across this thread while looking into a mix release issue I’ve run into recently.

Basically, I can start the release with start, but strangely, both daemon and daemon_iex do not produce any output whatsoever.

Not even an error message.

Looking around online, I found this Github issue for a Distillery bug:
https://github.com/bitwalker/distillery/issues/59

Which sounded pretty similar to the Mix Release issue I have.

Looking at what you’ve written, it sounds like start should be preferred to daemon anyway.

But might you have any idea about what’s breaking the daemon script?

jeroenbourgois

jeroenbourgois OP

Sorry, just saw your question now. No idea however.

dynamite-ready

dynamite-ready

No worries. There’s a resolution of some kind in this thread - Mix release starts with 'start' but not with 'daemon'

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
widianto
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews