Error Handling Done Differently

32
@michaelneale www.CloudBees.com Monday, 13 June 2011
  • date post

    19-Oct-2014
  • Category

    Technology

  • view

    2.774
  • download

    3

description

Architect Michael Neale expounds on errors, exceptions, Erlang, and how we do things at CloudBees. Bonus topic: the joys of Platform as a Service. Originally presented at Sydney YOW! night - Jun 14, 2011.

Transcript of Error Handling Done Differently

Page 1: Error Handling Done Differently

@michaelneale

www.CloudBees.com

Monday, 13 June 2011

Page 2: Error Handling Done Differently

Hosted build-time to Runtime - the full cycle

Monday, 13 June 2011

Page 3: Error Handling Done Differently

Monday, 13 June 2011

Page 4: Error Handling Done Differently

Tasty dog food

- we practice continuous deployment

- carefully...

(especially after that one time I...)

- bootstrapping !

Monday, 13 June 2011

Page 5: Error Handling Done Differently

Monday, 13 June 2011

Page 6: Error Handling Done Differently

CI in the cloud

- git push --> run tests, promote

- bees app:deploy

- BYO repo or use ours (even SVN ??)

Monday, 13 June 2011

Page 7: Error Handling Done Differently

Anyway... you can use it free

- signup www.cloudbees.com

- free FOSS Jenkins CI hosting

- free general Apps hosting

- “public cloud” or private edition (hybrid?)

- thousands of apps hosted already

Monday, 13 June 2011

Page 8: Error Handling Done Differently

Why a PaaS ?

- System administration challenged

- Make it someone else’s problem

- why not? just PLEASE think about lock in

Monday, 13 June 2011

Page 9: Error Handling Done Differently

My experience

- fell in love with GAE, force.com

- terrified of any and all lock in at the time

- had nothing better to do ... so cloudbees...

Monday, 13 June 2011

Page 10: Error Handling Done Differently

Heaven to use

Hell to build **

Purgatory to manage **

** Not Your Problem.

Monday, 13 June 2011

Page 11: Error Handling Done Differently

Some things we use to get it done:

- scala (back end apps)

- ruby (chef, rails, proxymachine, lots)

- java (jenkins and plugins)

- erlang (“agents” and lots more..)

Monday, 13 June 2011

Page 12: Error Handling Done Differently

But what I really want to talk quickly about ...

Monday, 13 June 2011

Page 13: Error Handling Done Differently

Exceptions. Errors.

What The Hell Is That Process Doing?

and how it relates to..

Monday, 13 June 2011

Page 14: Error Handling Done Differently

Keeping things running without falling into a weeping trembling mess in the corner every time you hear an SMS sound or a phone ring or an email chime etc etc etc.....

Monday, 13 June 2011

Page 15: Error Handling Done Differently

Exception handling is wrong...

Monday, 13 June 2011

Page 16: Error Handling Done Differently

But it seems harmless...

Monday, 13 June 2011

Page 17: Error Handling Done Differently

Monday, 13 June 2011

Page 18: Error Handling Done Differently

Monday, 13 June 2011

Page 19: Error Handling Done Differently

Erlang says no no no...

Monday, 13 June 2011

Page 20: Error Handling Done Differently

Question: a process on server not responding

Answer:

1) panic

2) take time thinking about underlying cause

3) bounce the bastard and pray **

Monday, 13 June 2011

Page 21: Error Handling Done Differently

FACT: Answer#3 will often work so well, you often don’t really spend time to think about #2**

** FibreError?

Monday, 13 June 2011

Page 22: Error Handling Done Differently

Imagine a programming environment:

- unlimited process spawning

- concurrency someone else’s problem

- don’t try to handle errors - let it fail

Monday, 13 June 2011

Page 23: Error Handling Done Differently

Erlang

Built for stability, and not bothering me.

Anything else is gravy.

Monday, 13 June 2011

Page 24: Error Handling Done Differently

Process isolation

- it works so well

- nothing shared

- has worked so well for so long with OSes

- in erlang - each ‘process’ is like a process !

Monday, 13 June 2011

Page 25: Error Handling Done Differently

...

nginx

supervisor

p1 p999

Erlang process

Example: My Host OS

haproxy

Each: own heap, garbage collector

Monday, 13 June 2011

Page 26: Error Handling Done Differently

Erlang processes, like OS processes

- Can only send messages to each other

- Can fail independently

- Can be restarted, safely

- Easy to write apps for - Old School !

Monday, 13 June 2011

Page 27: Error Handling Done Differently

Better

- Tiny overhead (can have 100K+ of them !)

- perfect for supervisory agents

- distribute: run on every box if you like !

- lots of processes == lots of concurrency

- if you need to block, block !

Monday, 13 June 2011

Page 28: Error Handling Done Differently

We use them for

- Supervisory agents - controllers

- Autoscaling services (realtime data analytics)

- misc backend systems

- fun command line tools !

Monday, 13 June 2011

Page 29: Error Handling Done Differently

Supervisor configuration

- Declare rules for restarting, failure

- So you don’t have to intervene !

- can hot reload changes

- can have dependent processes

Monday, 13 June 2011

Page 30: Error Handling Done Differently

Restart just busted process

Monday, 13 June 2011

Page 31: Error Handling Done Differently

Anyway, that is why we use Erlang, also...

- RabbitMQ

- Riak (nosql DB)

- CouchDB (nosql DB)

- Probably your telephone exchange

Monday, 13 June 2011

Page 32: Error Handling Done Differently

Thank you

Monday, 13 June 2011