Live data from Hacker News

Do messages get lost when Erlang modules are upgraded?

pankajmore.in

1–10 of 37 posts

Re: Do messages get lost when Erlang modules are upgraded?

#2
Hot code reloading is really amazing in Erlang. We use it to patch a method without restarting on a regular basis. Getting reltool properly configured to deploy the new version of your application though is a MAJOR pain in the ass.

for the non-erlangers:

the 'simple' way (ie i have a tiny change i want to make, so i'll just ssh in and do it) is to just edit your code, then attach to an existing node, and do make:all([load]) to pick up the code changes. we added a makefile "make attach" that does this for us.

the 'reltool' way is you package your application into releases. We use jenkins build numbers as the third digit in our releases, so each one is packaged into a zip, encrypted, and then is ready to deploy. at deploy time, the zip is copied to all machines, then we use some escript to attach to the running nodes, and use the 'release_handler' bring up the N+1 version of our app. it's a pain but once it's configured it's amazing...

Re: Do messages get lost when Erlang modules are upgraded?

#3

Hot code reloading is really amazing in Erlang. We use it to patch a method without restarting on a regular basis. Getting reltool properly configured to deploy the new version of your application though is a MAJOR pain in the ass. for the non-erlangers: the 'simple' way (ie i have a tiny change i want to make, so i'll just ssh in and do it) is to just edit your code, then attach to an existing node, and do make:all(…

I would love to see more information about how you guys configured reltool. I really loved using hot code reloads in Erlang, but always did them manually during development. I could get releases to work, but never felt confident in how to use them properly.

Re: Do messages get lost when Erlang modules are upgraded?

#4
post #3

Hot code reloading is really amazing in Erlang. We use it to patch a method without restarting on a regular basis. Getting reltool properly configured to deploy the new version of your application though is a MAJOR pain in the ass. for the non-erlangers: the 'simple' way (ie i have a tiny change i want to make, so i'll just ssh in and do it) is to just edit your code, then attach to an existing node, and do make:all(…

I would love to see more information about how you guys configured reltool. I really loved using hot code reloads in Erlang, but always did them manually during development. I could get releases to work, but never felt confident in how to use them properly.

sounds good. i'm about to start a whisper tech blog and we can do that as our first post...

Re: Do messages get lost when Erlang modules are upgraded?

#5

Hot code reloading is really amazing in Erlang. We use it to patch a method without restarting on a regular basis. Getting reltool properly configured to deploy the new version of your application though is a MAJOR pain in the ass. for the non-erlangers: the 'simple' way (ie i have a tiny change i want to make, so i'll just ssh in and do it) is to just edit your code, then attach to an existing node, and do make:all(…

I am excited about a new kid on the block for releases: http://relx.org/

Re: Do messages get lost when Erlang modules are upgraded?

#7
post #6

This is pretty far from what other frameworks and systems can even dream about. Not everyone needs this but when they do need it, I only know about Erlang that can handle it.

I have to say "when one REALLY-REALLY-REALLY-REALLY BADLY need it". Because the same effect can be achieved by different means most of the time.

Re: Do messages get lost when Erlang modules are upgraded?

#8
post #7
post #6

This is pretty far from what other frameworks and systems can even dream about. Not everyone needs this but when they do need it, I only know about Erlang that can handle it.

I have to say "when one REALLY-REALLY-REALLY-REALLY BADLY need it". Because the same effect can be achieved by different means most of the time.

How? You have a C++ or Java object instance running in a process how do you upgrade that code without restarting the process?

Re: Do messages get lost when Erlang modules are upgraded?

#9
post #8
post #7

Earlier quoted context omitted.

I have to say "when one REALLY-REALLY-REALLY-REALLY BADLY need it". Because the same effect can be achieved by different means most of the time.

How? You have a C++ or Java object instance running in a process how do you upgrade that code without restarting the process?

I imagine you would do what erlang does for you, just manually - isolate individual server instances, do the update, then make them public again.

Say for example you are updating code in your service's web-tier. Have your LBs not send any more new traffic to the server instance, wait some reasonable length of time until existing connections are completed, deploy, restart, give LBs the A-OK to start traffic up again. Repeat until all web-tier instances are updated.

Re: Do messages get lost when Erlang modules are upgraded?

#10
post #8
post #7

Earlier quoted context omitted.

I have to say "when one REALLY-REALLY-REALLY-REALLY BADLY need it". Because the same effect can be achieved by different means most of the time.

How? You have a C++ or Java object instance running in a process how do you upgrade that code without restarting the process?

According to the wiki the OpenJDK supports Hotswap https://wiki.openjdk.java.net/display/mlvm/HotSwap .

As for C or C++ it is platform specific, but shared objects and DLLs have been runtime loadable/unloadable for as long as I can remember. Building a hot swap feature on top of it would be challenging but doable.

Post reply on HN