Do not retain initial SchemaContext 24/57424/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 4 May 2017 21:52:57 +0000 (23:52 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 19 May 2017 12:31:10 +0000 (12:31 +0000)
While looking over a memory dump I have noticed that we retain
SchemaContext inside Shard$Builder, which is being retained via
Props (which are used to restart the actor).

This reference is not updated as the SchemaContext is updated, which
means we are wasting memory and are causing Shard to come up with
an ancient SchemaContext after a failure.

Fix this by having an AtomicReference holder for SchemaContext
and have Shard have a Supplier<SchemaContext>.

Change-Id: I73fcae46f249d3679522eb7dbbb059e43c5af6c7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>

No differences found