Opened 9 years ago

Closed 6 years ago

#1215 closed defect (fixed)

Concurrent queries on client side

Reported by: Dimitar Misev Owned by: Dimitar Misev
Priority: major Milestone: 9.7
Component: rasodmg Version: development
Keywords: Cc: Vlad Merticariu, Peter Baumann
Complexity: Medium

Description

.. seem to be shipped to the same rasserver. To reproduce you can use the attached code

cd applications/rasql
tar xzf test_concurrent_client.tar.gz
make query
./query

It sends the same query from two threads, and in the server log I see:

 [INFO] - 05/02/2016 12:57:36.241746: Request: 'select avg_cells(c) from test_rgb2 as c'...
 [INFO] - 05/02/2016 12:57:36.241782: Request: 'select avg_cells(c) from test_rgb2 as c'...
 [INFO] - 05/02/2016 12:57:36.241800: parsing...
 [INFO] - 05/02/2016 12:57:36.241813: parsing...
Error number: 300 Token: ( Line: 1 Column: 19
 [INFO] - 05/02/2016 12:57:36.241908: rasserver terminated.

Attachments (2)

test_concurrent_client.tar.gz (2.0 KB ) - added by Dimitar Misev 9 years ago.
0001-ticket-1215-fix-thread-safety-in-rasodmg.patch (8.0 KB ) - added by Dimitar Misev 6 years ago.

Download all attachments as: .zip

Change History (6)

by Dimitar Misev, 9 years ago

comment:1 by Alex Toader, 9 years ago

I do not think this is related to rasnet. It is related to raslib not being very thread safe.

comment:2 by Dimitar Misev, 8 years ago

Owner: changed from Alex Toader to bbell
Status: newassigned

comment:3 by Dimitar Misev, 6 years ago

Cc: Peter Baumann added; Alex Dumitru removed
Component: rasnetrasodmg
Milestone: 10.09.7
Owner: changed from bbell to Dimitar Misev

Patch is under review.

You can see the API changes in rasodmg that fixing this requires in this documentation patch.

The issue in more detail: rasodmg is not thread-safe because it uses global r_Database and r_Transaction objects, which was further propagated in clientcomm. This patch removes the global objects; as a consequence, some rasodmg API change a bit with an additional parameter (the r_Transaction object, which in turn contains the r_Database object).

comment:4 by Dimitar Misev, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed finally, there are optional arguments in several places where the transaction object should be specified if thread-safety is needed. I will update the documentation as well to add notice about this.

Note: See TracTickets for help on using tickets.