[erlang-questions] Is -on_load() still experimental? Anyone using it?
Fri Jan 24 19:16:13 CET 2014
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.
Founder and Lead Developer
On Fri, Jan 24, 2014 at 6:58 PM, Jachym Holecek <>wrote:
> Hi Ferenc,
> # Ferenc Holzhauser 2014-01-24:
> > Recently stumbled into the -on_load() directive. It seems nice to replace
> > manual work (when possible) e.g. when a live update of a library module
> > needs some environment/configuration change on the running system.
> > doc:
> > It says it is experimental (since R13B03).
> > After trying, it appears to be doing what I think it supposed to but
> > looking at this note in the doc I'm not sure how safe it is to use in
> > production.
> > Could somebody advise?
> It is clearly not safe to use in production because that's what
> Also, the -on_load() functionality has been introduced to support automatic
> NIF loading (not that this was a problem that really needed solving, IMHO).
> Have you investigated if it really fits your use case well? This snippet
> from documentation would unsettle me just a little bit on a live system:
> "A process that calls any function in a module whose on_load function
> has not yet returned will be suspended until the on_load function has
> It doesn't specify if this applies just to initial loading of a module or
> also to runtime code updates, system behaviour in the latter case could
> be disastrous.
> Further, automatic configuration changes are a touchy topic. What if some-
> thing goes wrong in the middle of your automatic update, and you end up
> with inconsistent state? How do you rollback then? Especially if the
> whole stuff is hidden where Operations won't see it?
> Personally, I'd advise to solve boring problems in boring ways...
> -- Jachym
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions