I n s
- l
i d a r i t y w i t h t h e p e
- p
l e
- f
F e r g u s
- n
a n d t h e i r p r
- t
e s t s a g a i n s t p
- l
i c e v i
- l
I n s o l i d a r i t y w i t h t h e p e o p - - PowerPoint PPT Presentation
I n s o l i d a r i t y w i t h t h e p e o p l e o f F e r g u s o n a n d t h e i r p r o t e s t s a g a i n s t p o l i c e v i o l e n c e H o w t o M a k e E r
“ B a c k t
h e F u t u r e ™ ” i s a t r a d e ma r k
U n i v e r s a l C i t y S t u d i
, I n c . a n d A mb l i n E n t e r t a i n me n t , I n c . I a m c l a i mi n g f a i r u s e
t h i s t r a d e ma r k a n d l
I ma g e f r
f u s i
n d u s t r i e s 1 . t r i p
. c
“ E r r
” c
s f r
a L a t i n v e r b me a n i n g “ t
t r a y ” . F
r p u r p
e s , e r r
s a r e c a s e s w h e r e t h e e x e c u t i
a p r
r a m s t r a y s f r
i t s u s u a l p a t h . We ’ l l b e c
s i d e r i n g e r r
s i n r e l a t i
t
i g h
e v e l l a n g u a g e p r
r a mmi n g a n d d i s t r i b u t e d s y s t e ms . E r r
s a t
h e r l a y e r s –
e r a t i n g s y s t e ms , h a r d w a r e , e t c . – a r e i mp
t a n t b u t n
w h a t t h i s t a l k i s f
u s s e d
. T h i s i n c l u d e s : c a s e s t h a t t h e l a n g u a g e
p r
r a m d e f i n e s t
e e r r
s ; c a s e s w h e r e t h e l a n g u a g e i mp l e me n t a t i
p r
r a m i s u n a b l e t
e t i t s s p e c i f i c a t i
. E r r
h a n d l i n g i s t h e r e s p
s e t
r r
s . A n e r r
h a n d l i n g m e c h a n i s m i s a f e a t u r e
a l a n g u a g e d e s i g n e d t
n a b l e r e s p
d i n g t
r r
s . A n e r r
h a n d l i n g p a t t e r n i s a p a t t e r n
u s e
a l a n g u a g e t
e s p
d (
n
! ) t
r r
s . T h i s t a l k i s a b
t e n g i n e e r i n g
e r r
h a n d l i n g me c h a n i s ms a n d p a t t e r n s f
d e p e n d a b i l i t y . D e p e n d a b i l i t y me a n s c
s i s t e n t l y d
n g s
t h i n g r e a s
a b l e , t h a t
h e r c
e
a u s e r c
l d d e p e n d
, i n t h e f a c e
p
e n t i a l e r r
s . L e t ’ s c
s i d e r s
c
n e r r
h a n d l i n g me c h a n i s ms a n d p a t t e r n s , a n d w h a t c a n g
r
g w i t h t h e m.
F
e x a mp l e , P O S I X s a y s : “ T h e s e t t i n g
e r r n
f t e r a s u c c e s s f u l c a l l t
f u n c t i
i s u n s p e c i f i e d u n l e s s t h e d e s c r i p t i
t h a t f u n c t i
s p e c i f i e s t h a t e r r n
h a l l n
b e mo d i f i e d . ” S
h e c
n l y u s e d p a t t e r n ( r e c
n d e d i n f
n
e 2 2
t h e C 9 9 a n d C 1 1 s t a n d a r d s )
s e t t i n g e r r n
e r
e f
e a f u n c t i
c a l l a n d t h e n c h e c k i n g t h a t i t i s n
e r
f t e r w a r d i s i n c
r e c t ; i n a l mo s t a l l c a s e s i t ’ s n e c e s s a r y t
h e c k t h e r e t u r n v a l u e a f t e r e a c h c a l l i n s t e a d . Wi n d
s ’ G e t L a s t E r r
i s e v e n l e s s c
s i s t e n t t h a n t h i s .
T h e c a u s e
t h e G n u T L S c e r t i f i c a t e c h e c k i n g b u g w a s a c
i n a t i
s e v e r a l
t h e s e p r
l e ms . T h e r e w a s a f u n c t i
c a l l e d
check_if_ca
t h a t w a s d e f i n e d t
e t u r n n
e r
f g i v e n a C A c e r t i f i c a t e , b u t t h i s c
f l i c t e d w i t h t h e u s u a l c
v e n t i
i n G n u T L S
r e t u r n i n g a n e g a t i v e i n t e g e r f
a n e r r
. T h e b u g w a s i n t r
u c e d b y a r e f a c t
i n g t h a t c h a n g e d ma n y f u n c t i
s , mo s t
w h i c h u s e d t h e u s u a l r e t u r n c
v e n t i
. C l e a n u p h a n d l i n g w a s a l s
f a c t
b e c a u s e i t r e s u l t e d i n t h e r e t u r n b e i n g f u r t h e r f r
t h e c
e t h a t c h e c k e d f
e r r
s . I n t h e A p p l e O p e n S S L “ g
a i l ; ” b u g , t h e c l e a n u p c
e w a s w r i t t e n i n c
r e c t l y , r e s u l t i n g i n p a r t
t h e n e c e s s a r y c
e f
c e r t i f i c a t e c h e c k i n g b e i n g b y p a s s e d .
A d d a n e x t r a v a l u e
a t y p e t
n d i c a t e a n e r r
. O p e r a t i
s t h a t a r e g i v e n a n e r r
v a l u e f
a n y
t h e i r i n p u t s , u s u a l l y p r
a g a t e i t t
h e i r
t p u t . E x a mp l e s :
I E E E 7 5 4 N a N v a l u e s S Q L N U L L , s
t
( i t s s e ma n t i c s a r e mo r e s u i t e d t
e p r e s e n t i n g mi s s i n g i n f
ma t i
) a s a n
j e c t
i e n t e d p r
r a mmi n g p a t t e r n ( n
t
e c
f u s e d w i t h t h e N u l l O b j e c t p a t t e r n )
P r
l e ms :
I f
l y s
t y p e s h a v e e r r
v a l u e s , w e g e t u n i n t u i t i v e b e h a v i
r ( e . g . d u e t
a v i n g a n e r r
v a l u e f
double
b u t n
f
boolean)
. I f a l l t y p e s h a v e e r r
v a l u e s ( a s i n S Q L ) , w e n e e d a t h r e e
a l u e d l
i c w h i c h i s u n f a mi l i a r . T h e r e i s a t e mp t a t i
t
f l a t e “ mi s s i n g ”
“ n
a p p l i c a b l e ” v a l u e s w i t h e r r
v a l u e s , e v e n i f t h e i r s e ma n t i c s s h
l d b e d i f f e r e n t . O n t h e
h e r h a n d , a d d i t i
a l c
l e x i t y c a n a r i s e f r
h a v i n g mu l t i p l e k i n d s
e r r
v a l u e ( f
e x a mp l e “ q u i e t ” a n d “ s i g n a l l i n g ” N a N s i n I E E E 7 5 4 ) . O p e r a t i
s t h a t t a k e a n e r r
v a l u e a s i n p u t ma y n
p r
u c e
e a s
t p u t ( e . g . t h e 2 8 I E E E 7 5 4 s t a n d a r d s a y s t h a t
pow(1, quietNaN) a
n d
pow(quietNaN, 0)
s h
l d r e t u r n 1 ) . E r r
v a l u e s c a n e n d u p b e i n g s t
e d i n u n a n t i c i p a t e d p l a c e s , d e l a y i n g t h e d e t e c t i
a n e r r
t
r b i t r a r i l y l
g a n d f a r a w a y f r
i t s i n t r
u c t i
. ( A l t h
g h w e c
l d i n p r i n c i p l e r e c
d d e b u g i n f
ma t i
a b
t w h e r e t h e e r r
v a l u e w a s f i r s t i n t r
u c e d , t y p i c a l l y t h a t i s n ’ t d
e . ) I t i s e a s y t
t c h e c k i n g f
a n e r r
( u n l e s s “ s i g n a l l i n g ” e r r
v a l u e s a r e u s e d , b u t t h
e r e q u i r e a n a d d i t i
a l e r r
h a n d l i n g me c h a n i s m f
t h e s i g n a l l i n g ) .
Wh a t d
s t h i s J a v a p r
r a m p r i n t ?
public class P { static <T> boolean equals_itself(T x) { return x == x; } static <T> boolean equals(T x, T y) { return x == y; } public static void main(String[] args) { double d = Double.NaN; System.out.println("d == d: " + (d == d)); System.out.println("equals_itself(d): " + equals_itself(d)); System.out.println("equals(d, d): " + equals(d, d)); } }
Wh a t d
s t h i s J a v a p r
r a m p r i n t ?
public class P { static <T> boolean equals_itself(T x) { return x == x; } static <T> boolean equals(T x, T y) { return x == y; } public static void main(String[] args) { double d = Double.NaN; System.out.println("d == d: " + (d == d)); System.out.println("equals_itself(d): " + equals_itself(d)); System.out.println("equals(d, d): " + equals(d, d)); } } java P d == d: false equals_itself(d): true equals(d, d): false ( I n
main,
“
==”
i s v a l u e e q u a l i t y
doubles
, w h i c h i s
false
f
NaN == NaN.
I n
equals_itself and equals,
“
==”
i s r e f e r e n c e e q u a l i t y
b
e d
Double
j e c t s . S
w i l l a l w a y s r e t u r n
true,
w h i l e e q u a l s ( x , x ) w i l l r e t u r n
false
f
p r i mi t i v e t y p e s , s i n c e b
i n g i s r e p e a t e d f
e a c h a r g u me n t . )
P r
e d b y J
n B . G
e n
g h i n 1 9 7 4 / 5 . T h e r e w e r e
h e r p r
a l s w i t h s i mi l a r p r
e r t i e s a t a b
t t h e s a me t i me
s l i g h t l y e a r l i e r , f
e x a mp l e t h e s i g n a l l i n g me c h a n i s m i n s e c t i
8 . 1
[ L M S 1 9 7 4 ] . G
e n
g h ’ s 1 9 7 5 p a p e r i s a c l a s s i c , v e r y t h
g h a n d w e l l
r i t t e n , a n d i t me n t i
s a l l
t h e me c h a n i s ms i n t h e p r e v i
s s l i d e s . H i g h l y r e c
n d e d ! I ' m g
n g t
s s u me k n
l e d g e
h
e x c e p t i
s w
k i n r e c e n t l a n g u a g e s . G
e n
g h ’ s
i g i n a l p r
a l d i f f e r e d i n t h e f
l
i n g w a y s : T y p i c a l l y , e x c e p t i
s a r e n
l y d e s i g n e d t
e u s e d t
i g n a l e r r
s . G
e n
g h d i s c u s s e d u s i n g t h e m a s a g e n e r a l f l
c
t r
me c h a n i s m, a n d p
s i b l y b e i n g r a i s e d f r
e v e r y c a l l t
r
t i n e . H e a l s
i s c u s s e d a p p l i c a t i
s s u c h a s p r
r e s s mo n i t
i n g t h a t w
l d b e a p
f i t t
x c e p t i
s a s i mp l e me n t e d i n mo s t c u r r e n t l a n g u a g e s . C
n L i s p ' s c
d i t i
/ r e s t a r t me c h a n i s m i s p r
a b l y p r
i d e s t h e n e a r e s t t h i n g t
h i s
i g i n a l p r
a l t h a t h a s b e e n i mp l e me n t e d i n a w i d e l y u s e d l a n g u a g e . I n
h e r l a n g u a g e s , a p p l i c a t i
s f
t h i s e x t r a f u n c t i
a l i t y w
l d p r
a b l y b e b e t t e r i mp l e me n t e d v i a c
t i n u a t i
s
g e n e r a t
s . E x c e p t i
s w e r e a h u g e i mp r
e me n t
p r e v i
s t e c h n i q u e s : B y d e f a u l t , i f a c a l l e r i n c l u d e s n
r r
h a n d l i n g c
e , t h e e x c e p t i
w i l l b e p r
a g a t e d t
t s c a l l e r . T h e e x c e p t i
h a n d l e r
l y r u n s i n t h e e r r
c a s e , s
t i s i mp
s i b l e f
i t t
s s u p t h e n
r r
c a s e . I n s
l a n g u a g e s , i t i s p
s i b l e t
t a t i c a l l y d e c l a r e w h i c h e x c e p t i
s a r
t i n e c a n r a i s e .
U n f
t u n a t e l y , t h i s s y s t e m d
s n
c
e w e l l i n g e n e r a l . T h e { n
h r
, s t r
g } s u b s e t c
e s w e l l : n
h r
→ n
h r
( ) s t r
g → n
h r
( ) s t r
g → s t r
g ( ) n
h r
→ t r y { s t r
g ( ) } c a t c h a l l { n
h r
( ) } A d d i n g a d e e p f r
e n c l a s s i f i e r f
t h i n g s t h a t r e f e r e n c e n
r e e x i s t i n g s t a t e , a l s
e s w e l l : s t r
g → d e e p f r
e n ( ) s t r
g { → f , m = d e e p f r
e n ( ) ; t r y { f ( m) } c a t c h a l l { s t r
g ( ) } } ( T h e n a me a n d d e f i n i t i
d e e p f r
e n c
s f r
t h e a u d i t i n g s y s t e m
E . ) B u t i f w e h a v e a b a s i c
e r a t i
, i t ' s d i f f i c u l t t
s t r
g
n
h r
e r a t i
f r
i t . A b r a h a ms ’ p a p e r s u g g e s t s c
y i n g , s
t h i n g l i k e t h i s : s t r
g { → f = d e e p f r
e n ( ) ; t r y { m 2 = c
y ( m1 ) ; f ( m2 ) } c a t c h a l l { s t r
g ( ) } } B u t w e ma y n
w a n t t
y ! T h e g
l ma y b e t
d i f y t h e
i g i n a l
j e c t / s t r u c t u r e . I n t h e
i g i n a l c
t e x t
t h e C + + s t a n d a r d l i b r a r y , t h i s p r
l e m i s n
s
i s i b l e b e c a u s e t h e c l a s s i f i e r s a r e b e i n g s p e c i f i e d
l y f
“ l e a f ”
e r a t i
s . B u t f
a p p l i c a t i
p r
r a mmi n g , i t d e f e a t s t h e g e n e r a l a p p l i c a b i l i t y
t h e w h
e i d e a – u n l e s s t h e l a n g u a g e p r
i d e s s u p p
t f
e n s u r i n g t h a t mu t a t i n g
e r a t i
s c a n b e g i v e n t h e s t r
g g u a r a n t e e i n g e n e r a l .
I n G
e n
g h ’ s 1 9 7 5 p a p e r , i t w a s b r i e f l y s u g g e s t e d t h a t “ S
t i me s a s a s i d e
f f e c t
t e r mi n a t i n g t h e
e r a t i
, i t i s n e c e s s a r y t
n d
l l e f f e c t s
a t t e mp t i n g t h e
e r a t i
. ” H
e v e r , t h i s w a s n
t a k e n u p b y a n y
t h e ma i n s t r e a m l a n g u a g e s t h a t i mp l e me n t e d e x c e p t i
s . R e c
e r y b l
k s a r e a n
h e r me c h a n i s m i n w h i c h r
l b a c k i s a n e s s e n t i a l p a r t
t h e s e ma n t i c s . T h e y w e r e p r
e d a r
n d t h e s a me t i me a s e x c e p t i
s ( 1 9 7 4 ) , b y B r i a n R a n d e l l ’ s r e s e a r c h g r
p a t t h e U n i v e r s i t y
N e w c a s t l e u p
T y n e ( w h i c h e v
v e d i n t
h e D e p e n d a b i l i t y R e s e a r c h G r
p ; s e e [ R a n d e l l 1 9 9 7 ] f
t h e h i s t
y ) . A r e c
e r y b l
k l
s l i k e t h i s : ensure acceptance_test
by Alt1 [else by Alt2 ⁝ else by Altn] else error
F i r s t
Alt1
i s e x e c u t e d . I f i t f a i l s
i f t h e a c c e p t a n c e c
d i t i
i s n
t r u e a f t e r i t s e x e c u t i
,
Alt2
i s e x e c u t e d , a n d s
. I f n
e
t h e a l t e r n a t e s s u c c e e d i n ma k i n g t h e a c c e p t a n c e c
d i t i
t r u e , t h e n t h e
ensure
c
s t r u c t f a i l s . N
e t h a t t h e a l t e r n a t e b l
k s c a n f a i l i n d e p e n d e n t l y
t h e a c c e p t a n c e t e s t . T h i s c a n h a p p e n i f a l l a l t e r n a t i v e s
a n e s t e d b l
k f a i l ,
i f t h e r e i s s
e r r
s i g n a l l e d b y t h e l a n g u a g e
p r
r a m. T h e a c c e p t a n c e c
d i t i
c a n r e f e r t
a r i a b l e s b
h b e f
e a n d a f t e r t h e e x e c u t i
t h e a l t e r n a t e s .
C
a r e :
ensure true by Alt1 else by Alt2 else error
T h e d i f f e r e n c e i s t h a t i n t h e r e c
e r y b l
k , s t a t e c h a n g e d b y Alt1 w i l l b e r
l e d b a c k b e f
e e x e c u t i n g Alt2, i f Alt1 f a i l s . I f r e c
e r y b l
k s w e r e u s e d c
s i s t e n t l y i n p l a c e
e x c e p t i
s , t h e e f f e c t w
l d b e t h a t a l l c
e w
l d s a t i s f y t h e s t r
g e x c e p t i
g u a r a n t e e . ( I t i s u n
s e r v a b l e w h e t h e r t h e r
l b a c k i s d
e b y e a c h f u n c t i
t h a t i s c a l l e d w h e n i t p r
a g a t e s a n e x c e p t i
,
b y e n s u r e c
s t r u c t s , p r
i d e d t h a t i t i s n e v e r p
s i b l e t
a t c h a n e x c e p t i
w i t h
t p e r f
mi n g r
l b a c k . ) T h e a c c e p t a n c e c
d i t i
a n d t h e a b i l i t y t
a t c h
l y a s u b s e t
e r r
s a r e i n e s s e n t i a l d i f f e r e n c e s : w e c
l d e x t e n d t r y / c a t c h w i t h a n a c c e p t a n c e c
d i t i
,
p r
i d e a w a y f
a l t e r n a t e s i n a r e c
e r y b l
k t
e p e n d
w h i c h e r r
i s r a i s e d b y a p r e v i
s a l t e r n a t e . ( R a n d e l l e t a l q u i t e d e l i b e r a t e l y a v
d e d t h e l a t t e r , b u t i t d
s i n c r e a s e e x p r e s s i v e n e s s . ) T h e i n t e n t i s a l s
i f f e r e n t h
e v e r : t h e r
e
a l t e r n a t e s i n a r e c
e r y b l
k i s t
r
i d e a l t e r n a t i v e i mp l e me n t a t i
s f
a n
e r a t i
, w h e r e a s e x c e p t i
s a r e n
ma l l y u s e d t
l e a n u p a n d /
t
i v e r t c
t r
f l
.
try { Alt1 } catch all { Alt2 }
I ma g i n e w e h a v e a t r y / r
l b a c k c
s t r u c t , w h i c h w
k s l i k e t r y / c a t c h b u t r
l s b a c k a n y s t a t e c h a n g e s b e f
e t h e r
l b a c k b l
k e x e c u t e s . T h e n w e h a v e t h e f
l
i n g e q u i v a l e n c e :
e n s u r e a c c e p t b y Alt1 e l s e b y Alt2 . . .
e l s e b y Altn e l s e e r r
T h i s i s a l
a l ma c r
r a n s f
ma t i
, s
h e
i g i n a l r e c
e r y b l
k s y n t a x d
s n ’ t p r
i d e a n y g r e a t e r e x p r e s s i v e n e s s . H
e v e r i t h a s a n i c e s y n t a x t h a t d
s n ’ t r e q u i r e t h e r e p e t i t i
“ a s s e r t a c c e p t ( ) ” , a n d t h a t g u i d e s p r
r a mme r s t
a r d u s i n g t h e s a me a c c e p t a n c e t e s t f
e a c h
t h e a l t e r n a t e b l
k s . T h i s i s h i g h l y d e s i r a b l e b e c a u s e i t a i d s u n d e r s t a n d i n g
t h e p r
r a m i n d e p e n d e n t l y
t h e d e t a i l s
a l l t h e b l
k s . A l l
i n g a n a c c e p t a n c e t e s t t
e f e r t
a r i a b l e s b
h b e f
e a n d a f t e r t h e a l t e r n a t e b l
k c a n b e s u p p
t e d b y c a p t u r i n g t h e v a r i a b l e s r e f e r r e d t
y t h e t e s t .
d e f a c c e p t ( ) { . . . } t r y { Alt1; a s s e r t a c c e p t ( ) } r
l b a c k a l l { t r y { Alt2; a s s e r t a c c e p t ( ) } … r
l b a c k a l l { Altn; a s s e r t a c c e p t ( ) } … }
T e x t r e a d s : “ S p e c i a l
f e r ! 5 f
t h e p r i c e
1 ( i s h ) : S t r
g e x c e p t i
g u a r a n t e e , C
c u r r e n t G C w r i t e b a r r i e r , R e v e r s i b l e e x e c u t i
, S i d e e f f e c t c
f i n e me n t , I n t e g r i t y e n f
c e me n t . T e r ms a n d c
d i t i
s a p p l y . ”
We h a v e t w
i n s
r c e s
i d e a s :
t i mi s a t i
s f
t r a i l i n g i n P r
, a n d w r i t e b a r r i e r e l i s i
f
c
c u r r e n t G C . M
t
t h e t r a i l i n g
t i mi s a t i
s a r e b a s e d
t h e i d e a t h a t w e
l y n e e d t
e t a i n s u f f i c i e n t i n f
ma t i
t
e t t h e s t a t e b a c k t
r e c
e r y p
n t , n
a n y a r b i t r a r y e x e c u t i
p
n t . A l t h
g h i t ma y b e p
s i b l e t
l i d e w r i t e b a r r i e r s b a s e d
r u n
i me t e s t s , t h e c
t
t h e t e s t
f s e t s t h e s a v i n g , s
h i s i s n
w
t h w h i l e (
w a s n ’ t f
P r
[ S c h r i j v e r s a n d D e mo e n 1 9 8 8 § 2 . 1 ] ) . T h e mo s t i mp
t a n t
t i mi z a t i
s c
f r
s t a t i c a n a l y s i s : S
c
e i s s t a t i c a l l y k n
n n
t
t a i n r e c
e r y p
n t s . Wr i t i n g t
l
a t i
l y r e q u i r e s a n u n d
n t r y i f t h e l
a t i
e x i s t e d a t t h e l a s t r e c
e r y p
n t , a n d
l y f
t h e f i r s t w r i t e a f t e r a r e c
e r y p
n t . We c a n h
s t b a r r i e r s a b
e l
s t h a t c
t a i n n
e c
e r y p
n t s . I f a l
i s p r
a b l y g
n g t
r i t e t
r a n g e
l
a t i
s , w e c a n t r a i l t h a t r a n g e , a v
d i n g s
e r h e a d a s s
i a t e d w i t h t r a i l i n g e a c h l
a t i
. S i mi l a r l y f
s t e r e
y p e d p a t t e r n s
w r i t e s t
n
j e c t ’ s f i e l d s . I f w e k n
t h a t a p r
e d u r e i s p a s s e d a l
a t i
t h a t i t w r i t e s t
w e c a n c h a n g e a l l c a l l e r s t
r a i l t h a t l
a t i
b e f
e t h e c a l l , a n d n
t h e c a l l e e d
s n
n e e d t
( T h e a d v a n t a g e i s t h a t w e mi g h t b e a b l e t
u r t h e r
t i mi z e b y h
s t i n g , me r g i n g e t c . i n t h e c a l l e r s . )
C l a r i f i c a t i
: “ d i s t r i b u t e d ” d
s n
n e c e s s a r i l y me a n a c r
s a n e t w
k ; c
n i c a t i n g n
e s c a n b e
t h e s a me ma c h i n e . I n a v a t
a s e d e v e n t l
mo d e l , w e c a n t r e a t a n y s u b s e t
v a t s a s a “ n
e ” . F a u l t t
e r a n c e i n d i s t r i b u t e d me s s a g e p a s s i n g a n d /
s h a r e d me mo r y s y s t e ms h a s b e e n a w e l l
t u d i e d f i e l d f
a t l e a s t 4 y e a r s . H
e v e r , a d
t i
f a u l t
e r a n t p r
s h a s b e e n l i mi t e d . T h i s i s p r
a b l y d u e t
h e c
l e x i t y
mo s t e x i s t i n g p r
s t h a t r e q u i r e c l
e c
d i n a t i
b e t w e e n n
e s . O n e
t h e ma i n p r
l e ms i s t h e “ d
n
f f e c t ” , i n w h i c h e r r
r e c
e r y
a g i v e n n
e c a n r e q u i r e c a s c a d i n g r
l b a c k s
h e r n
e s . T h e f
k w i s d
d i s t r i b u t e d f a u l t t
e r a n c e h a s t e n d e d t
s s u me t h a t t h e d
n
f f e c t i s i n e v i t a b l e . We n e e d s
t h i n g s i mp l e r a n d mo r e c
a b l e ! K e n i s a f a mi l y
p r
s t h a t p r
i d e e r r
r e c
e r y f
d e t e c t e d f a u l t s w i t h
t t h e d
n
f f e c t . I mp l e me n t a t i
s : Wa t e r k e n f
J a v a / J
p r
r a ms , d e v e l
e d b y T y l e r C l
e C K e n f
C p r
r a ms M a c e K e n , i n t e g r a t e d w i t h t h e M a c e d i s t r i b u t e d
y s t e ms t
k i t b y H y
n K y u C h
c h e m e K e n f
S c h e m e v 8
e n , f
G
l e ’ s v 8 i mp l e me n t a t i
J a v a s c r i p t . R e s e a r c h a t H e w l e t t
a c k a r d u s e s t h e t e r m C O V R ( C
a b l e O u t p u t
a l i d R e s i l i e n c y ) t
e s c r i b e t h e p r
e r t i e s
t h i s p r
f a mi l y .
A l l c
n i c a t i
b e t w e e n n
e s i s b y me s s a g e p a s s i n g a c c
d i n g t
h e r u l e s b e l
. E a c h n
e h a s a s t a t e t h a t i s c h e c k p
n t e d r e a s
a b l y f r e q u e n t l y , a n d i n d e p e n d e n t l y
h e r n
e s . T h e s t a t e i n c l u d e s i n c
n g a n d
t g
n g me s s a g e s . C h e c k p
n t s a r e w r i t t e n d u r a b l y t
h e n
e ’ s p e r s i s t e n t s t
a g e . I f a n
e f a i l s , i t r e s t
e s f r
t h e l a s t c
l e t e c h e c k p
n t . ( I t s b e h a v i
r i n t h i s c a s e c a n ’ t b e d i s t i n g u i s h e d f r
a n
e t h a t h a d b e e n r u n n i n g mo r e s l
l y . ) O u t g
n g me s s a g e s a r e r e l e a s e d i n t h e s a me a t
c a c t i
a s c h e c k p
n t i n g . We n e e d t h i s a n y w a y f
l
a l e r r
r e c
e r y . We a r e i n c u r r i n g a l a t e n c y c
t f
d e l a y i n g r e l e a s e
t g
n g me s s a g e s u n t i l a t u r n i s c
t t e d , b u t w e a r e p a y i n g t h i s c
t
l y
c e f
l
a l e r r
r e c
e r y a n d f
K e n . We n e e d t
h e c k p
n t e v e r y t i me w e r e l e a s e me s s a g e s t
n
h e r n
e , b u t n
n e c e s s a r i l y a t e v e r y t u r n . R e l e a s e d me s s a g e s a r e p e r i
i c a l l y r e t r a n s m i t t e d u n t i l t h e y a r e a c k n
l e d g e d . T h e y c a n b e d e l e t e d f r
t h e s t a t e
l y a f t e r t h e y a r e a c k n
l e d g e d . D u p l i c a t e a c k n
l e d g e me n t s a r e d i s c a r d e d . A r e c e i v e d me s s a g e i s n
a c k n
l e d g e d u n t i l a f t e r i t h a s b e e n r e c
d e d i n a c h e c k p
n t . ( [ H P L
1
5 5 ] s a y s a c k n
l e d g e me n t s s h
l d b e d e l a y e d u n t i l t h e me s s a g e h a s b e e n p r
e s s e d . T h i s i s n ’ t n e c e s s a r y f
t p u t v a l i d i t y i f a p p l i c a t i
s d
s e e a c k n
l e d g e me n t s . ) R e c e i v e d me s s a g e s t h a t a n
e h a s a l r e a d y r e c
d e d a r e r e a c k n
l e d g e d a n d t h e n d i s c a r d e d . I t ma y a l s
e d e s i r a b l e t
n f
c e me s s a g e
d e r i n g g u a r a n t e e s s u c h a s p a i r w i s e F I F O
d e r i n g . T h a t ’ s i t !