►
From YouTube: BE Pairing - EMEA/APAC - 2023-09-13 - Reactive Caching
Description
Exploring weird behavior in reactive caching / rescue in this MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129561
Documentation on reactive caching: https://gitlab.com/gitlab-org/gitlab/-/blob/5209dd4b628df856e8ac1abe7a42a509730c0dd6/doc/development/reactive_caching.md
C
B
So
we
had
this
a
few.
A
few
weeks
ago,
we
had
a
community
submitted
Mr
to
refactor
some
duplicate
code
in
our
training,
security
training
providers
classes.
B
B
It
wasn't
covered
by
our
tests,
I
subsequently
added
a
test
which
actually
picked
it
and
we
reverted
the
change
and
but
during
the
during
the
analysis
of
it,
I
came
across
something
very
odd
with
the
reactive
caching
code.
Is
anybody
on
the
call
know
how
to
elevate
a
pitch
reactive?
Caching
as
we
use
it.
A
No
I
was
gonna,
say:
I've
never
opened
up
the
reactive
caching
concern
I
have
no
idea.
What's
in
there.
B
So
I'm
not
entirely
sure
about
everything
that
it
does,
but
my
understanding
is
that
you
can
brings
concern
into
a
what
usually
seems
to
be
used
in
model
objects
and
you
can
perform
an
expensive
operation
in
the
background
job
that
will
eventually
load.
It
will
cache
the
result
from
that.
Oh
that
one.
C
D
B
B
B
I'll
I
think
it's
less
important
like
what
this
is
doing
to
actually
and
to
just
show
the
weird
Behavior
we
would
gain
so
I'll
just
go
ahead
and
try
and
do
that.
Okay,
so
we
have
these
training
provider
binders
now
they're
not
actually
binders
like
most
of
our
finders
they're,
not
active
record
query
builders.
B
Folks
who
provide
security,
training
for
different
issues
and
they
and
they
come
back.
Those
providers
come
back
with
the
URL.
So
if
you've
got
you
know,
cve
one
two
three,
you
can
say
give
me
a
URL
that
will
give
me
some
training
on
that
issue
and
the
training
provider
comes
back
with
that
URL.
So
that's
the
part
that
we
cache
is
the
call
out
to
those
providers.
B
And
what
had
been
done
in
the
Mr
to
clean
up
was
the
author
noticed
basically
that
this
this
method
here
reactive
cache,
is
this?
We
have
three
subclasses
of
this
Base
Class.
B
B
B
C
C
B
Are
starting
Italy?
Oh.
B
So
what
was
interesting
we
might
even
be
able
to
see
from
this
stack
Trace.
Is
that
so
we
had
this
not
implemented
error.
B
So
that's
basically
on
the
bass
class.
D
B
It's
basically,
if
you're,
using
like
virtualization
or
something
and
you
and
the
instruction
isn't
implemented,
then
that's
the
error
that
gets
phrased.
So
it's
not
really
made
for
being
put
in
user
code,
but
people
do
all
the
time.
And
crucially,
it's
not
a
it's,
not
a
child
of
standard
error.
C
B
B
But
so
what
happens
here
is
that
this
this
piece
blows
up
in
an
Ensure
Block
in
this
class,
which
we
had
opened.
Didn't
we
so.
B
So
let
me
find
where
the
it's
happening.
The
air
is
happening
here,
145.
A
B
So
basically
like,
if
an
exception
happens
in
here,
then
this
this
code
will
run
and
it
will
run
if
an
exception
doesn't
happen
as
well,
so
it's
guaranteed
to
run
so
when
the
code
is
in
here-
and
it
has
one
of
these-
it's
been
called
on
one
of
these
objects,
one
of
these
subclasses,
the
class
that
it
references.
B
Let
me
just
put
into
here
notes
so
glass,
not
name.
B
B
B
But
they,
let
me
see
if
I
can
get
the
test
around
again.
I
might
actually
just.
B
B
C
B
And
they're
hopeful
that
this
is
kind
of
I'm,
really
sorry,
I
didn't
have
time
to
get
this
really
before
cool
with
them.
A
A
B
B
B
I
feel
like
there
was
a
might
be
in
Mr
like
there
was
a
refactor,
oh
yeah,
there's
a
him
are
in
Flight
I.
Think
that
reflectors
some
of
this.
B
Did
which
is
weird?
Because
it
wasn't
doing
to
me
the
other
day
assuming
I'm
running
the
right,
one,
which
I
think
of
him.
A
B
B
Sorry,
this
is
not
the
error
that
I
had
before.
C
C
I'm,
sorry,
so
this
area
you
were
getting
after
the
after
drying
up
the
modules
not.
B
So
that
what
this
one
oh,
this
is
the
revert.
So
so
we
can
see
what
I
undid
yes.
A
C
B
No,
that
spec
that
I've
been
running
I
added
after
the
original
Mr,
because
we
had
no
spec
but
caught
the
era.
So
basically
the
the
graphql
endpoint
wasn't
being
tested
in
a
request:
spec.
It
was
just
being
tested
in
the
unit
test
which
didn't
call
the
background
workers.
B
B
Yeah
to
the
base,
so
they
added
query
string.
A
B
That
I
read
lately
to
the
to.
D
B
A
B
Like
our
secrets
so
come
on
then
come
on
them
Wizards.
How
would
you
apply
this.
D
C
B
C
B
Wow
failed
I.
B
D
C
B
D
Okay,
you
need
to
take
care
of
those
later
I
guess
yeah.
B
I,
don't
think
yeah,
sorry,
if
I'm
in
the
top
level.
Okay,
now,
where
are
we
at.
B
B
D
B
So
and
here's
like
you
know,
this
is
what
I
was
saying
before
right.
So
we
go
okay,
it's
gone
for
URL
finder,
it's
Contra,
URL
finder
and
then
it's
basic
URL
finder,
but
the
object
still
has
all
of
the
properties
that
the
country
URL
finder,
had.
B
So
I
mean
maybe
seem
a
query
string
method,
that's
actually
bombing
out.
B
This
is
wrong.
Sorry
could
be
very
strong.
B
Creature
of
habit,
I
suppose
well,
I,
don't
I
I,
don't
know
if
Pride
does
it
anymore,
but
it
didn't
used
to
be
able
to
do
like
a
step,
step
debugging
and
going
up
and
down
the
stack
and
things
like
that
which
I
sometimes
want
to
do
it.
Does
it
do
it
now
by
default.
A
I
believe
that
it
does
I,
don't
know
I've
ever
used
before
it
was
created
by
somebody
at
your
lab,
and
it
allows
you
to
pry
in
different
parts.
I
was
trying
to
open
a
pry
in
a
worker,
because
I
couldn't
figure
out
how
to
invoke
this
worker
synchronously.
A
It
was
like
you
need
a
lot
of
really
complex
args,
so
binding.pryshell
allows
you
to
like
connect
that
that
pry
session,
which
is
cool
even
if
it's
in
the
background
process
but
I,
was
having
and
it
uses,
buy
bug
by
default,
but
I
was
having
I
was
able
to
step
into
method
sometimes,
and
then
sometimes
it
was
like
not
letting
me
get
confused
about
whether
I
was
in
a
price
session
or
not
so.
B
A
D
Yeah,
it's
a
deal
yeah.
The
alternative
would
have
been
to
start
sidekick
like
synchronously
in
a
in
a
session
on
your
terminal
and
then
let
it
do
that.
A
C
A
B
B
B
Possibly
not
the
object,
actually
what
what
was
happening
is
that
I
don't
know
if
I
can
easily
do
this
again
here,
essentially
this
at
this
point
in
the
code,
but
if
you
say
self-stop
self-classed
on
name
it
gives
you
the
correct
class
name
and
then
at
this
point
I
think
it
doesn't.
D
B
B
Yeah
and
as
as
I
say,
I
did
just
a
vanilla,
Ruby
class
and
a
module
and
like
the
same
sort
of
override
setup
and
it
didn't
work.
There
is
something
from
active
support
play
here,
which
is
class,
attribute.
I.
Think
last
attribute
right,
so
here
so
I
think
this
is
perhaps.
B
Oh,
why
it's
behaving
a
little
bit
differently,.
B
It
does
it
does.
Those
are
like
I
can't
remember
what
Sam's
expression
was
for,
where
shared
context
came
from
the
other
week
in
that
he
wasn't
a
fan,
but
these
are
from
the
same
places.
There
yeah.
B
B
Never
to
use
it
unless,
like
that's
the
behavior,
you
want,
which
you
pretty
much,
never
do
I.
Think
but
anyway,
this
class
attribute
thing
declare
a
class
level
attribute
whose
value
is
inheritable
by
subclasses.
B
And
they
behave
in
they
be
they
behave
like
normal
eyebars
in
the
way,
but
I
think
they're,
not
thread
safe,
I
believe
so
the
they
can
create
problems.
I
think
that's
correct.
Don't
quote
me
on
that,
but.
B
Yeah
I
can
create
anyway
getting
off
paste.
Then.
A
B
Only
because
I
couldn't
reproduce
it
using
like
regular
methods
in
no,
it
might
be.
Another
Factor,
but,
like
I,
tried
to
make
a
really
simple
test
case
with
just
a
module
and
a
couple
of
and
a
class
and
a
base
class
and
a
method
that
calls
insure
and
I
just
didn't
see
the
same
Behavior
I
guess.
The
thing
that
maybe
we
could
look
at
is.
B
And
is
it
a
concern
that
we
because
I
think
what's
potentially
happening?
Is
that
we're
not
canceling
the
right
cash
key
in
this
call
in
sometimes
potentially.
D
B
D
B
D
B
D
The
gist
of
it
but
I
haven't
talked
about
the
specifics.
B
B
A
D
Least
yeah,
it's
probably
to
prevent
good
luck.
B
D
D
D
D
It
still
in
Reg
ister
what
in
their
register,
do
the
colon
registers
you
should.
You
might
still
see
it
like.
B
D
But
yeah
there
it
is,
and
then
you
still
see
it
in
quote
in
double
quote
zero.
You
can
do
double
Code,
Zero,
p
and
it'll
paste
that
one.
C
D
A
B
Error
no
I
saw
it
in
production
is
exactly
the
same
thing
yeah,
but
that's
interesting.
D
B
Like
right,
because
because
the
module
so
they're
they're
coming
from
the
the
reactive
caching
concern.
D
B
D
C
C
C
D
I
think
so
you
could
try
to
rescue
and
then
probably.
D
B
And
then
we
get
the
exception
from.
B
Okay,
so
I
think
maybe
that's
yeah.
That
would
explain
my
confusion
should
cover
it
in
the
supply
box.
C
B
B
B
B
Yeah
I
think
we
probably
don't
need
to
dig
any
further
on
this.
Then
it's
not
as
weird
an
error
as
I
thought.
It
was
I
thought.
B
So
all
right,
I'm
gonna,
stop
share
there.
Yeah
thanks
folks.
B
A
A
That
are
like
the
nice
thing
about
going
through.
That
is
that
you
were
looking
into
kind
of
like
weirdness
with
rescues,
and
that's
exactly.
The
kind
of
bug
that
I've
been
working
with
is
like.
It
feels
like
something's
being
rescued
somewhere.
That
shouldn't
be
like
things
are
silently
failing,
which
is
the
scariest
type
of
failure.
So.
B
A
A
C
B
C
A
B
B
A
And
I
truly
before
you
mentioned
it
today,
I
didn't
realize
that
the
the
reason
for
not
using
it,
because
I
too,
have
seen
that
pattern,
a
ton
and
always
thought
it
was
a
good
way
of
or
like
it
just
seemed
to
be
the
default
way
of
ensuring
that,
when
you're
using
inheritance,
you're
implementing
the
interface
that
you
expect.
B
Yeah
and
it's
interesting,
so
if
you
look
at
the
top
there
like
rational
item,
one
is
like
this
exception
is
for,
if
you
don't
Implement
things
like
Fork,
if
it's
a
platform
that
you're
running
on
doesn't
Implement
an
instruction
or
something
very,
very
low
level,
there
is
clearly
not
like
if
you
cut,
if
you
want
to
fork,
and
you
can't
Fork,
there's
no
way
to
carry
on
or
you're
trying
to
allocate
memory.
A
A
Although
it'd
be
a
relatively
easy
one
to
just
change
right
like
I
guess
you
should
use
the
easy
word,
but
swapping
it
for
something
standard
doesn't
seem.
D
B
So
no
method
error
like
it
would
make
sense
to
me
if
no
message
error
wasn't
used
all
over
the
place
for.
D
B
A
B
C
A
Know
exactly
well,
and
it's
just
it
is
helpful,
like
I,
really
love
the
way
I
get
lab.
We
use
rural
cop
to
when,
when
it's
used
to
enforce
things
that
actually
like
you
always
want
to
do
like.
Sometimes
it's
annoying
because
you
have
to
say:
oh
I,
don't
actually
don't
want
to
do
that
in
this
situation,
but
this
seems
like
a
case
where
anytime
somebody
got
through
book
up
error.
They
would
just
change
it
and
they
wouldn't
be
like
no
I
need.
You
know.
A
I
need
to
rescue,
not
Implement
air
I
need
to
raise
an
implemented
error.
It
seems
like
that
would
never
happen
that
has
happened
to
me
today.
We
talked
about
this
I.
Think
almost
was
it
last
week
about
people.
Misspelling
aggregate
failures
are
doing
aggregated
failure.
I
did
today
I
did
that
I
added
aggregate
errors
like
three
times
in
the
rubicop
raised
before
I,
could
commit,
because
that
doesn't
do
anything.
I
was
like.
Thank
you,
so
I
think
this
would
be.
A
Very
good
at
writing
repo
cop
rules,
but
this
one
seems
like
it
wouldn't
be
that
bad,
it's
a
string
match.
D
A
B
A
C
So
what
will
the
own
exception
class
will
do?
What
that
no
method
is
not
to.
C
C
A
Yeah
double
Advocate,
exactly
like
I
guess
when
I've
used
this
pattern
in
the
past,
the
intention
is
that
it
would
never
reach
an
end
User.
It's
like
it's
almost
like
just
a
tip
to
developers,
and
so
you
really
kind
of
want
to
throw
the
air
in
their
face
because
you're
like
this
is
an
error.
You
cannot
rescue
it
like.
You
have
to
override
this
method.
That's
how
I've
used
it
in
the
past,
but
I
understand
that
there
are
situations
where
those
kinds
of
things
sneak
through
to
end.
C
B
Yeah
I,
don't
know
if
you
look
at
if
you
look
at
the
class
of
errors
that
are
in
that
group,
they
are
literally
things
like
out
of
memory
like
there
is
literally
no
way
you
can
carry
on
executing
if
you're
out
of
memory
is
done,
you're
over
finished,
yeah
yeah,
this,
like
not
not
having
a
method
available,
is
not
on
that
kind
of
spectrum
of
Errors.
You
know
it's.
D
C
D
A
base
class
you
could
either
have
an
empty
method
and
then
the
specs
should
show
that
you're
doing
something
wrong
or
you
just
don't
care
that
it's
a
no-op.
D
Why
does
it
need
to
be
a
hard
hard
hit
like
that?
The
only
reason
it
it's
useful
is
because
we
have
some
form
of
coverage,
specs
that'll
make
sure
every
path
gets
hit
and
then,
through
that
it'll
hit
the
not
implemented
error
currently,
but
in
another
sense
you
should
have
probably
have
the
unit
specs
anyway
that
are
going
to
ensure
that
whatever
you're
calling
on
that,
whatever
your
subclassing
is
doing
something
useful.
So
it
seems
like
safety
net.
That's
not
really
needed
seems
weird.
B
Yeah
I
think
the
other
thing
for
me
is
using
that
patent
was
the
you
know
the
error
method
in
the
base
class.
It
kind
of
moves
the
stack
Trace
to
a
potentially
less
like.
If
you
do
error
out,
you
end
up
erroring
out
from
the
Base
Class
rather
than
from
the
caller
yeah,
which
might
make
more
sense
if
it
errors
out
in
the
caller
of
that
method.
It's
like
okay,
I,
see
where
this
happened.
I
don't
know
it's.
D
B
B
B
C
D
Maybe
we
should
just
I,
don't
know,
must
make
a
must
Implement
class
method,
and
then
it
looks
if
methods
defined
are
there
or
not
uninitialized
yeah.