Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResultSetEnumerable should be closed if an exception occurs in Interpreter #56

Open
julianhyde opened this issue Jul 12, 2021 · 0 comments

Comments

@julianhyde
Copy link
Collaborator

ResultSetEnumerable should be closed if an exception occurs in Interpreter. Currently it is not; for example, AlgebraTest.testExistsCorrelated has a bug that throws UnsupportedOperationException (see stack 1) and about a dozen other tests hang, waiting for connections to hsqldb. Evidently that one bad test has exhausted the connection pool by retrying each time it gets the error.

Stack 1 (for the test that throws)

java.lang.UnsupportedOperationException
	at org.apache.calcite.interpreter.JaninoRexCompiler.lambda$compile$0(JaninoRexCompiler.java:96)
	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.visitFieldAccess(RexToLixTranslator.java:1367)
...
	at org.apache.calcite.interpreter.JaninoRexCompiler.compile(JaninoRexCompiler.java:103)
	at org.apache.calcite.interpreter.Interpreter$CompilerImpl.compile(Interpreter.java:395)
	at org.apache.calcite.interpreter.Nodes$CoreCompiler.compile(Nodes.java:48)
	at org.apache.calcite.interpreter.FilterNode.<init>(FilterNode.java:34)
	at org.apache.calcite.interpreter.Nodes$CoreCompiler.visit(Nodes.java:58)
...
	at org.apache.calcite.interpreter.Interpreter$CompilerImpl.visitRoot(Interpreter.java:312)
	at org.apache.calcite.interpreter.Interpreter.<init>(Interpreter.java:88)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode.lambda$eval$2(Calcite.java:173)
	at net.hydromatic.morel.util.ThreadLocals.let(ThreadLocals.java:52)
	at net.hydromatic.morel.util.ThreadLocals.mutate(ThreadLocals.java:72)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode.lambda$eval$3(Calcite.java:170)
	at net.hydromatic.morel.util.ThreadLocals.let(ThreadLocals.java:52)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode.eval(Calcite.java:168)
	at net.hydromatic.morel.compile.Compiler.lambda$compileValDecl$17(Compiler.java:600)
	at net.hydromatic.morel.compile.Compiler$1.lambda$eval$0(Compiler.java:97)
	at net.hydromatic.morel.util.ThreadLocals.let(ThreadLocals.java:37)
	at net.hydromatic.morel.compile.Compiler$1.eval(Compiler.java:93)
	at net.hydromatic.morel.Ml.eval(Ml.java:362)
	at net.hydromatic.morel.Ml.lambda$assertEval$8(Ml.java:348)
	at net.hydromatic.morel.Ml.lambda$withValidate$3(Ml.java:181)
	at net.hydromatic.morel.Ml.withParser(Ml.java:104)
	at net.hydromatic.morel.Ml.withValidate(Ml.java:175)
	at net.hydromatic.morel.Ml.assertEval(Ml.java:345)
	at net.hydromatic.morel.Ml.assertEval(Ml.java:341)
	at net.hydromatic.morel.Ml.assertEvalIter(Ml.java:337)
	at net.hydromatic.morel.AlgebraTest.testExistsCorrelated(AlgebraTest.java:658)

Stack 2 (for one of several tests that hangs due to connection pool exhaustion)

	- parking to wait for  <0x0000000700ee0b68> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2081)
	at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:590)
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:425)
	at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:346)
	at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
	at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:809)
	at org.apache.calcite.runtime.ResultSetEnumerable.enumeratorBasedOnStatement(ResultSetEnumerable.java:267)
	at org.apache.calcite.runtime.ResultSetEnumerable.enumerator(ResultSetEnumerable.java:257)
	at org.apache.calcite.linq4j.EnumerableDefaults$17$1.<init>(EnumerableDefaults.java:2814)
	at org.apache.calcite.linq4j.EnumerableDefaults$17.enumerator(EnumerableDefaults.java:2813)
	at org.apache.calcite.interpreter.Interpreter$CompilerImpl.source(Interpreter.java:421)
	at org.apache.calcite.interpreter.Nodes$CoreCompiler.source(Nodes.java:48)
	at org.apache.calcite.interpreter.AbstractSingleNode.<init>(AbstractSingleNode.java:33)
	at org.apache.calcite.interpreter.ProjectNode.<init>(ProjectNode.java:31)
...
	at org.apache.calcite.interpreter.Interpreter$CompilerImpl.visitRoot(Interpreter.java:312)
	at org.apache.calcite.interpreter.Interpreter.<init>(Interpreter.java:88)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode.lambda$eval$2(Calcite.java:173)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode$$Lambda$2617/0x0000000800dad040.get(Unknown Source)
	at net.hydromatic.morel.util.ThreadLocals.let(ThreadLocals.java:52)
	at net.hydromatic.morel.util.ThreadLocals.mutate(ThreadLocals.java:72)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode.lambda$eval$3(Calcite.java:170)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode$$Lambda$2615/0x0000000800daf440.get(Unknown Source)
	at net.hydromatic.morel.util.ThreadLocals.let(ThreadLocals.java:52)
	at net.hydromatic.morel.foreign.Calcite$CalciteCode.eval(Calcite.java:168)
	at net.hydromatic.morel.compile.Compiler.lambda$compileValDecl$17(Compiler.java:600)
	at net.hydromatic.morel.compile.Compiler$$Lambda$1845/0x0000000800e5e840.apply(Unknown Source)
	at net.hydromatic.morel.compile.Compiler$1.lambda$eval$0(Compiler.java:97)
	at net.hydromatic.morel.compile.Compiler$1$$Lambda$1898/0x0000000800ee7c40.run(Unknown Source)
	at net.hydromatic.morel.util.ThreadLocals.let(ThreadLocals.java:37)
	at net.hydromatic.morel.compile.Compiler$1.eval(Compiler.java:93)
	at net.hydromatic.morel.Ml.eval(Ml.java:362)
	at net.hydromatic.morel.Ml.lambda$assertEval$8(Ml.java:348)
	at net.hydromatic.morel.Ml$$Lambda$754/0x0000000800cb2440.accept(Unknown Source)
	at net.hydromatic.morel.Ml.lambda$withValidate$3(Ml.java:181)
	at net.hydromatic.morel.Ml$$Lambda$757/0x0000000800cb2c40.accept(Unknown Source)
	at net.hydromatic.morel.Ml.withParser(Ml.java:104)
	at net.hydromatic.morel.Ml.withValidate(Ml.java:175)
	at net.hydromatic.morel.Ml.assertEval(Ml.java:345)
	at net.hydromatic.morel.Ml.assertPlan(Ml.java:333)
	at net.hydromatic.morel.AlgebraTest.testIntersect(AlgebraTest.java:507)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant