<div dir="ltr">Hi,<div><br></div><div>Thanks again for your insights and concerns.</div><div><br></div><div>Configuration change was an (apparently bad) example that I thought was close enough to my case that is a bit more extensive to explain.</div>
<div>I didn't think it was relevant for what I was curious about and didn't want to bore the list with it.</div><div>I've done some testing including system start and code (re)load an it did what I need without issues</div>
<div><br></div><div>What actually triggered me to ask the  list is that it has been marked experimental since R13B03 (a bit over 4 years now), </div><div><br></div><div>Perhaps my real questions should have been: Is this feature being looked at? Is there any intention to remove the experimental mark one day?</div>
<div><br></div><div>Regards,<br></div><div>Ferenc</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 January 2014 19:16, José Valim <span dir="ltr"><<a href="mailto:jose.valim@plataformatec.com.br" target="_blank">jose.valim@plataformatec.com.br</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Just to clarify, after Jachym's e-mail, I have been using -on_load exactly to load NIFs and that's the scenario it has been shown to work in my case. YMMV.<div class="gmail_extra">
<div class="im"><br clear="all"><div>

<div><br></div><div><br></div><div><span style="font-size:13px"><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><b>José Valim</b></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><div>


<span style="font-family:verdana,sans-serif;font-size:x-small"><a href="http://www.plataformatec.com.br/" style="color:rgb(42,93,176)" target="_blank">www.plataformatec.com.br</a></span></div><div><span style="font-family:verdana,sans-serif;font-size:x-small">Skype: jv.ptec</span></div>


<div><span style="font-family:verdana,sans-serif;font-size:x-small">Founder and Lead Developer</span></div></span></div></span></div></div>
<br><br></div><div class="gmail_quote"><div><div class="h5">On Fri, Jan 24, 2014 at 6:58 PM, Jachym Holecek <span dir="ltr"><<a href="mailto:freza@circlewave.net" target="_blank">freza@circlewave.net</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">

Hi Ferenc,<br>
<br>
# Ferenc Holzhauser 2014-01-24:<br>
> Recently stumbled into the -on_load() directive. It seems nice to replace<br>
> manual work (when possible) e.g. when a live update of a library module<br>
> needs some environment/configuration change on the running system.<br>
><br>
> doc: <a href="http://www.erlang.org/doc/reference_manual/code_loading.html#id84676" target="_blank">http://www.erlang.org/doc/reference_manual/code_loading.html#id84676</a><br>
><br>
> It says it is experimental (since R13B03).<br>
> After trying, it appears to be doing what I think it supposed to but<br>
> looking at this note in the doc I'm not sure how safe it is to use in<br>
> production.<br>
><br>
> Could somebody advise?<br>
<br>
It is clearly not safe to use in production because that's what EXPERIMENTAL<br>
means.<br>
<br>
Also, the -on_load() functionality has been introduced to support automatic<br>
NIF loading (not that this was a problem that really needed solving, IMHO).<br>
Have you investigated if it really fits your use case well? This snippet<br>
from documentation would unsettle me just a little bit on a live system:<br>
<br>
  "A process that calls any function in a module whose on_load function<br>
   has not yet returned will be suspended until the on_load function has<br>
   returned."<br>
<br>
It doesn't specify if this applies just to initial loading of a module or<br>
also to runtime code updates, system behaviour in the latter case could<br>
be disastrous.<br>
<br>
Further, automatic configuration changes are a touchy topic. What if some-<br>
thing goes wrong in the middle of your automatic update, and you end up<br>
with inconsistent state? How do you rollback then? Especially if the<br>
whole stuff is hidden where Operations won't see it?<br>
<br>
Personally, I'd advise to solve boring problems in boring ways...<br>
<br>
BR,<br>
        -- Jachym<br></div></div><div class="im">
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</div></blockquote></div><br></div></div>
</blockquote></div><br></div>