Skip to content

Commit

Permalink
Fix LivenessScope for SelectColumnLayer.doApplyUpdate, in order to en…
Browse files Browse the repository at this point in the history
…sure correct reference counting for parallel update in transform use cases (#3210)
  • Loading branch information
rcaudy authored Dec 15, 2022
1 parent 67c63f8 commit 6ced5cd
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.deephaven.engine.context.ExecutionContext;
import io.deephaven.engine.liveness.LivenessNode;
import io.deephaven.engine.liveness.LivenessReferent;
import io.deephaven.engine.liveness.LivenessScopeStack;
import io.deephaven.engine.rowset.*;
import io.deephaven.engine.table.*;
import io.deephaven.engine.table.impl.QueryTable;
Expand Down Expand Up @@ -291,13 +292,16 @@ private Boolean doApplyUpdate(final TableUpdate upstream, final UpdateHelper hel
final boolean isBackingChunkExposed =
ChunkedBackingStoreExposedWritableSource.exposesChunkedBackingStore(writableSource);

try (final ChunkSink.FillFromContext destContext =
needDestContext ? writableSource.makeFillFromContext(destContextSize) : null;
final ChunkSource.GetContext chunkSourceContext =
needGetContext ? chunkSource.makeGetContext(chunkSourceContextSize) : null;
final ChunkSource.FillContext chunkSourceFillContext =
needGetContext && isBackingChunkExposed ? chunkSource.makeFillContext(chunkSourceContextSize)
: null) {
try (final SafeCloseable ignored = LivenessScopeStack.open();
final ChunkSink.FillFromContext destContext = needDestContext
? writableSource.makeFillFromContext(destContextSize)
: null;
final ChunkSource.GetContext chunkSourceContext = needGetContext
? chunkSource.makeGetContext(chunkSourceContextSize)
: null;
final ChunkSource.FillContext chunkSourceFillContext = needGetContext && isBackingChunkExposed
? chunkSource.makeFillContext(chunkSourceContextSize)
: null) {

// apply shifts!
if (!isRedirected && preMoveKeys.isNonempty()) {
Expand Down

0 comments on commit 6ced5cd

Please sign in to comment.