-
Notifications
You must be signed in to change notification settings - Fork 211
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
Potential issue when multi-threading testing using virtuoso jdbc driver #1242
Comments
As it sounds like this only happens when connecting via JDBC, please provide full version details for both the Virtuoso JBDC Driver and the JVM/JDK/JRE in use. If you notice that either of these is not current, please retest with a current version of both, and either confirm that results are the same or provide any different results you see. It may also be necessary for us to know what Java tool you're using to make the JDBC connection and queries. |
One more thing — If possible, it would be helpful if you could also provide the complete JDBC connect string(s) in use during these tests. |
Sure. Here's my environment: > java --version
openjdk 17.0.8.1 2023-08-24
OpenJDK Runtime Environment (build 17.0.8.1+1-Ubuntu-0ubuntu122.04)
OpenJDK 64-Bit Server VM (build 17.0.8.1+1-Ubuntu-0ubuntu122.04, mixed mode, sharing) For other settings:
Messages from the client side:
This happened when I tried to execute the below code: Connection conn = DriverManager.getConnection(JDBCString);
try (Statement s = conn.createStatement()) {
s.execute(String.format("DROP TABLE %s_t%d", databaseName, i)); // Connection to the server lost
} catch (SQLException e1) { |
Hi, |
@timhaynesopenlink Thanks for your instruction. Here's the full log of the server. Generally, this testing process is to create some tables and send random queries using two threads. The crash would happen if I manually terminated (Ctrl+C the Java program) the first test run and at the time I started the second one. There might be some concurrency issues. Sorry but the automated testing tool is still under development. I'll try to make a minimal program that could reproduce this issue. However, I don't think there's complex logic in the Java part (just making normal JDBC calls, but concurrently) and the last queries I could observe were usually simple and could be various. |
Thanks for that - good to see the SQL queries as they happen. We'll hopefully have a look into it in the next few days. |
Development are now looking into it. We'll keep you posted. |
Hi, As a rule, mixing DML and DDL in this way is a Bad Idea. You should probably rethink the client application isolation boundaries - define a test block as a create+query*+drop sequence and then each thread performs a given test one at a time, thereby referencing only the tables pertinent to its current test. I have raised a bug internally for tracking in case we can think of a satisfactory way to avoid this. |
I am currently testing Virtuoso by building docker image following this: https://github.com/openlink/vos-reference-docker. Recently I frequently triggered the following crash in Virtuoso (I could reproduce on latest manual build from 604fdc7, openlink/virtuoso-opensource-7:latest, pkleef/virtuoso:latest):
Scenario:
Start testing with 2 threads (2 JDBC connections) by sending random SQL queries, after several seconds, close my testing program (The JDBC connection might not be closed properly).
Then I start testing with another 2 threads, and the crash happens. There might be some issues when handling the previous queries, as there's one strange string
B')) BETWEEN CAST(database0_t0.c1 AS VARCHAR) AND database0_t1.c1) UNION ALL SELECT database0_t0.c0, database0_t0.c1 FROM database0_t0, database0_t1 WHERE (NOT (((
in the server log. Here's the full server log in case it's useful.I think it might be regardless of what kind of SQL queries I used since I could not easily reproduced by using
isql
.Kindly inform me if I should provide more information.
The text was updated successfully, but these errors were encountered: