[ https://issues.apache.org/jira/browse/PHOENIX-962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13986079#comment-13986079 ]
Samarth Jain commented on PHOENIX-962: -------------------------------------- [~gabriel.reid] - A couple of comments on the test you wrote. 1) Because we are now executing tests in parallel (in forked JVM processes), it is recommended to set the master and region server ports to -1 in setupBeforeClass(). I have seen tests flapping otherwise. {code} conf = hbaseTestUtil.getConfiguration(); ConfigUtil.setReplicationConfigIfAbsent(conf); conf.set(QueryServices.DROP_METADATA_ATTRIB, Boolean.toString(true)); conf.setInt(QueryServices.MASTER_INFO_PORT_ATTRIB, -1); conf.setInt(QueryServices.REGIONSERVER_INFO_PORT_ATTRIB, -1); {code} You can probably avoid setting up all of the above if you just extend BaseConnectedQueryIT. The doSetup() method in that class takes care of setting things up properly. You can then get rid of the getUrl() method too. Also, you probably forgot a conn.commit() call in setUpBeforeClass() 2) Trivial but please remove System.out.println in testGetDatabaseMetadataWithDifferentContextClassloader and t.printStackTrace() in BadContextClassloaderThread > Basic querying fails if the current thread's context classloader is changed > --------------------------------------------------------------------------- > > Key: PHOENIX-962 > URL: https://issues.apache.org/jira/browse/PHOENIX-962 > Project: Phoenix > Issue Type: Bug > Affects Versions: 3.0.0 > Reporter: Gabriel Reid > Assignee: Gabriel Reid > Attachments: PHOENIX-962.patch > > > When using Phoenix 3.0.0 with HBase 0.94.x, any kind of basic querying fails > if the connection is used by a thread that has a custom context classloader > that doesn't link back up to the root classloader. > This sounds like a somewhat contrived situation, but it is the case in > clients where, for example, a Connection is instantiated within a background > thread within a thread pool, and then passed in to a UI framework that uses a > custom context classloader. > The underlying cause is that there is a static call to > HBaseConfiguration.create() within the HBase FilterList class, which is > instantiated for many query calls. The HBaseConfiguration.create() call adds > hbase-default (and other) resources to the underlying Configuration object, > but these underlying resources can no longer be loaded because they are > dependent on the context classloader for loading. Ensuring that the > FilterList class is loaded with a context classloader that is used for > loading other Phoenix classes will resolve this issue. -- This message was sent by Atlassian JIRA (v6.2#6252)