Skip to content

Commit

Permalink
Fix missing AuthContext on New Partition (#4550)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Caudy <ryan@deephaven.io>
  • Loading branch information
nbauernfeind and rcaudy committed Sep 25, 2023
1 parent 0d17b64 commit ae625af
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package io.deephaven.engine.table.impl.sources;

import io.deephaven.base.verify.Assert;
import io.deephaven.engine.context.ExecutionContext;
import io.deephaven.engine.rowset.*;
import io.deephaven.engine.rowset.RowSetFactory;
import io.deephaven.engine.table.*;
Expand Down Expand Up @@ -61,6 +62,7 @@ public class UnionSourceManager {
private final MergedListener mergedListener;
private final ConstituentChangesListenerRecorder constituentChangesListener;
private final UpdateCommitter<UnionSourceManager> updateCommitter;
private final ExecutionContext executionContext;

public UnionSourceManager(@NotNull final PartitionedTable partitionedTable) {
constituentChangesPermitted = partitionedTable.constituentChangesPermitted();
Expand Down Expand Up @@ -99,11 +101,17 @@ public UnionSourceManager(@NotNull final PartitionedTable partitionedTable) {

updateCommitter = new UpdateCommitter<>(this, partitionedTable.table().getUpdateGraph(),
usm -> usm.unionRedirection.copyCurrToPrev());

executionContext = ExecutionContext.newBuilder()
.markSystemic()
.captureUpdateGraph()
.build();
} else {
listenerRecorders = null;
mergedListener = null;
constituentChangesListener = null;
updateCommitter = null;
executionContext = null;
}

try (final Stream<Table> initialConstituents = currConstituents()) {
Expand Down Expand Up @@ -244,7 +252,8 @@ private MergedUnionListener(
protected void process() {
final TableUpdate constituentChanges = getAndCheckConstituentChanges();
final TableUpdate downstream;
try (final ChangeProcessingContext context = new ChangeProcessingContext(constituentChanges)) {
try (final SafeCloseable ignored = executionContext.open();
final ChangeProcessingContext context = new ChangeProcessingContext(constituentChanges)) {
downstream = context.processChanges();
} catch (Throwable ex) {
propagateError(false, ex, entry);
Expand Down

0 comments on commit ae625af

Please sign in to comment.