[JBoss JIRA] (TEIID-3099) RejectedExecutionException for Teiid during high query load
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3099?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-3099.
---------------------------------
> RejectedExecutionException for Teiid during high query load
> -----------------------------------------------------------
>
> Key: TEIID-3099
> URL: https://issues.jboss.org/browse/TEIID-3099
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine, Server
> Affects Versions: 8.7
> Environment: Windows (x64) and Mainframe z/OS (x64)
> Reporter: Mark Ackert
> Assignee: Steven Hawkins
> Labels: queryengine, rejectedexecutionexception, teiid-engine, threads
> Fix For: 8.7.1, 8.9
>
>
> Occasionally, when a standalone Teiid server is under high load from concurrent queries, a RejectedExecutionException is thrown. The relevant part of the stacktrace is below. I investigated the ThreadReuseExecutor source, and I believe the issue's cause is based around the sycnhronized(poolLock) code - see below the stack trace for info, and psuedo-code snippet with my analysis below the stacktrace.
> Caused by: java.util.concurrent.RejectedExecutionException: Task org.teiid.dqp.internal.process.ThreadReuseExecutor$3@c75a8114 rejected from org.teiid.dqp.internal.process.ThreadReuseExecutor$2@8b1166ec[Running, pool size = 128, active threads = 128, queued tasks = 0, completed tasks = 692637]
> at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java:2048) [rt.jar:1.7.0]
> at java.util.concurrent.ThreadPoolExecutor.reject(ThreadPoolExecutor.java:821) [rt.jar:1.7.0]
> at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1372) [rt.jar:1.7.0]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor.executeDirect(ThreadReuseExecutor.java:200) [teiid-engine-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor.execute(ThreadReuseExecutor.java:177) [teiid-engine-8.7.0.FinalCAFix-SNAPSHOT.jar:8.7.0.FinalCAFix-SNAPSHOT]
> In the below executeDirect, the race condition that appears plausible to me is: given "activeCount" is at the thread pool size limit and a single thread is finishing execution...Let activeCount be reduced by one in the tpe.execute runnable's synchronized block. The synchronized block exits, and goes to the warnWait/logging code - at this point a thread context switch occurs, and a new PrioritizedRunnable (one which isn't waiting on the poolLock at the beginning of the executeDirect method) comes through executeDirect and proceeds forward because "poolLock" has been released, "activeCount" is now sizeLimit-1. The tpe tries to execute a new Runnable wrapping this PrioritizedRunnable, but the previous thread which hasn't completed it's logging code yet is still present in the the threadpool, and as such we get a RejectedExecutionException due to too many threads trying to be executed in a fixed size thread pool.
> private void executeDirect(final PrioritizedRunnable command) {
> boolean atMaxThreads = false;
> synchronized (poolLock) {
> .... if activeCount!=max_limit; activeCount++
> }
> .......
> tpe.execute(.....
> finally {
> synchronized (poolLock) {
> .......
> activeCont--;
> }
> if (success) {
> ......some log code
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (TEIID-2930) SCROLL keyword for DECLARE CURSOR not being parsed correctly
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2930?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-2930.
---------------------------------
> SCROLL keyword for DECLARE CURSOR not being parsed correctly
> ------------------------------------------------------------
>
> Key: TEIID-2930
> URL: https://issues.jboss.org/browse/TEIID-2930
> Project: Teiid
> Issue Type: Bug
> Components: ODBC
> Affects Versions: 7.7.8
> Reporter: Johnathon Lee
> Assignee: Steven Hawkins
> Fix For: 8.8, 8.7.1, 7.7.11
>
>
> The DECLARE cursor is defined as [1]. However, in [2] line #155, the SCROLL keyword is not being matched. Correction would be to match the pattern fully as defined in [1]
> [1]
> http://www.postgresql.org/docs/8.4/static/sql-declare.html
> [2]
> https://github.com/teiid/teiid/blob/master/runtime/src/main/java/org/teii...
> Example of error:
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking server method: executeQuery [BEGIN;declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>;fetch 100 in "SQL_CUR0x11ad4120"]
> DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: START TRANSACTION
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [START TRANSACTION] expecting: EITHER
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as transaction statement
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: sendUpdateCount [BEGIN, 0]
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [show client_encoding] expecting: RESULTSET
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as show statement
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Creating ResultSet requestID: -1 beginRow: 1 resultsColumns: 1 parameters: 0
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: setEncoding [UTF-8]
> FINE [org.teiid.jdbc] (New I/O server worker #3-1) Statement closed successfully.
> DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months
[JBoss JIRA] (TEIID-2837) Cassandra: doesn't work with Case Sensitvie KEYSPACE and TABLE name
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2837?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-2837.
---------------------------------
> Cassandra: doesn't work with Case Sensitvie KEYSPACE and TABLE name
> --------------------------------------------------------------------
>
> Key: TEIID-2837
> URL: https://issues.jboss.org/browse/TEIID-2837
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Environment: Cassandra with Teiid 8.6
> Reporter: Ivan Chan
> Assignee: Steven Hawkins
> Labels: teiid
> Fix For: 8.7
>
>
> Teiid doesn't work with KeySpace or Table which contains UpperCase.
> Reference From Cassandra - Using double quote for Case Sensitive KeySpace and Table:
> http://www.datastax.com/docs/1.1/references/cql/CREATE_KEYSPACE
> Exception when try to deploy:
> java.lang.NullPointerException
> at org.teiid.translator.cassandra.metadata.CassandraMetadataProcessor.processMetadata(CassandraMetadataProcessor.java:52)
> at org.teiid.translator.cassandra.CassandraExecutionFactory.getMetadata(CassandraExecutionFactory.java:100)
> at org.teiid.translator.cassandra.CassandraExecutionFactory.getMetadata(CassandraExecutionFactory.java:53)
> at org.teiid.query.metadata.NativeMetadataRepository.loadMetadata(NativeMetadataRepository.java:61)
> at org.teiid.query.metadata.ChainingMetadataRepository.loadMetadata(ChainingMetadataRepository.java:55)
> at org.teiid.runtime.EmbeddedServer.loadMetadata(EmbeddedServer.java:644)
> at org.teiid.runtime.AbstractVDBDeployer.loadMetadata(AbstractVDBDeployer.java:161)
> at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:605)
> at org.teiid.runtime.EmbeddedServer.deployVDB(EmbeddedServer.java:536)
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
11 years, 4 months