From 87e87731c03a2269e0505a9d75788734142c377b Mon Sep 17 00:00:00 2001 From: Dmitry <58846611+dmitry-fa@users.noreply.github.com> Date: Tue, 29 Dec 2020 20:00:08 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20BigtableSession=20is=20never=20closed=20?= =?UTF-8?q?by=20Reader=20causing=20"ManagedChanne=E2=80=A6=20(#2782)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: BigtableSession is never closed by Reader causing "ManagedChannel allocation site" exceptions * fix: BigtableSession is never closed by Reader causing "ManagedChannel allocation site" exceptions (cherry picked from commit 5340db59ca2e78c513574b04f2173dea50fb637d) --- .../java/com/google/cloud/bigtable/beam/CloudBigtableIO.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bigtable-dataflow-parent/bigtable-hbase-beam/src/main/java/com/google/cloud/bigtable/beam/CloudBigtableIO.java b/bigtable-dataflow-parent/bigtable-hbase-beam/src/main/java/com/google/cloud/bigtable/beam/CloudBigtableIO.java index 098204e777..aa24e87fd7 100755 --- a/bigtable-dataflow-parent/bigtable-hbase-beam/src/main/java/com/google/cloud/bigtable/beam/CloudBigtableIO.java +++ b/bigtable-dataflow-parent/bigtable-hbase-beam/src/main/java/com/google/cloud/bigtable/beam/CloudBigtableIO.java @@ -699,6 +699,10 @@ public void close() throws IOException { scanner.close(); scanner = null; } + if (session != null) { + session.close(); + session = null; + } long totalOps = getRowsReadCount(); long elapsedTimeMs = System.currentTimeMillis() - workStart; long operationsPerSecond = elapsedTimeMs == 0 ? 0 : (totalOps * 1000 / elapsedTimeMs);