8000 Nicer templates by benmmurphy · Pull Request #500 · erlware/relx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Nicer templates #500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Conversation

benmmurphy
Copy link
Contributor

We run erlang in production and have noticed that it is quite easy to shoot yourself in the foot when accidentally typing ctrl-c or ctrl-s. Both of these shortcuts are easy to type if you are reaching for ctrl-a, ctrl-d or ctrl-r. ctrl-c by default will run the erlang emulator break handler that will pause the node. This can be destructive on a live system. ctrl-s will cause erlang to block flow control which has some very undesirable effects (see here: http://erlang.org/pipermail/erlang-patches/2010-March/000883.html)

The option to disable the break handler is commented out the vm_args file but you might want to make it the default.

I've also included a change to the script that will set the TERM variable to something sane. For example when deploying from capistrano this will be set to 'dumb' I think which causes problems when you attach to the node. However, it might be better to just hardcode TERM to a particular value. I'm not sure.

useful if deploying erlang nodes via capistrano
when TERM is not set correctly attaching to the
node will result in weirdness
+Bi disables the erlang break functionality
@tsloughter
Copy link
Member

What is export RUN_ERL_DISABLE_FLOWCNTRL=true?

@benmmurphy
Copy link
Contributor Author

mkdir /tmp/pipes
mkdir /tmp/log
run_erl /tmp/pipes /tmp/log erl&
to_erl /tmp/pipes

ctrl-s

try and type some stuff (this doesn't work for me on osx. but it does on linux ubuntu)

start crying

ctrl-q

q().

RUN_ERL_DISABLE_FLOWCNTRL=true run_erl /tmp/pipes /tmp/log erl&
to_erl /tmp/pipes

ctrl-s

start typing.

don't cry

more information here: http://erlang.org/pipermail/erlang-patches/2010-March/000883.html

@tsloughter
Copy link
Member

Ok, I'm fine with it being a new default but we should still allow it to be overridden. So something like:

RUN_ERL_DISABLE_FLOWCNTRL=${RUN_ERL_DISABLE_FLOWCNTRL:-true}
export $RUN_ERL_DISABLE_FLOWCNTRL

@ferd
Copy link
Collaborator
ferd commented Aug 19, 2016

Is this only for when you're using pipes? Pressing ctrl-c shouldn't stall a production node if you're using a remote shell to access it, it will interrupt the local handler only, not the one on the prod node.

@bitwalker
Copy link
Contributor

I think is meant to handle CTRL+S not CTRL+C, but yes I think this only meant for attaching to a pipe, not remote console.

@lrascao
Copy link
Collaborator
lrascao commented Oct 4, 2016

I think this makes sense since some times you need to attach to the node (to view console output for example), this reduces the probability of accidentally killing a node
+1 (if @tsloughter remark is implemented)
ping @benmmurphy

@lrascao
Copy link
Collaborator
lrascao commented Oct 27, 2016

closing since #528 has been merged

@lrascao lrascao closed this Oct 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0