You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was experimenting with what would happen if the code of the vrp functions were executed from a different extension name, this experiment is to look forward to move the vrp functions to a public different repository
So, I created a pgRouting extension and a vrpRouting extension with exactly the same code of pgRouting
and on the vrpRouting extension I ran:
PREPARE No_problem_query AS
SELECT * FROM vrp_pickDeliver(
$$ SELECT * FROM orders ORDER BY id $$,
$$ SELECT * FROM vehicles ORDER BY id$$,
$$ SELECT * FROM pgr_dijkstraCostMatrix(
'SELECT * FROM edge_table ',
(SELECT array_agg(id) FROM (SELECT p_node_id AS id FROM orders
UNION
SELECT d_node_id FROM orders
UNION
SELECT start_node_id FROM vehicles) a),
directed => false)
$$
);
this is combines pgRouting and vrpRouting
SELECT * FROM vrp_pickDeliver(
...
$$ SELECT * FROM pgr_dijkstraCostMatrix(
...
Which generated a server crash.
The way it generated the server crash was as follows:
For simplification:
pgtap test = pgtap test with one or more queries that combines the 2 extensions
test = a pgtap test can have or can not have a query that combines the 2 extensions
Ran a pgtap test without problems, but when the next test started the server crash happened.
2021-01-17 09:05:24.776 CST [15181] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2021-01-17 09:05:24.777 CST [19237] vicky@pgr_test__db__test WARNING: terminating connection because of crash of another server process
2021-01-17 09:05:24.777 CST [19237] vicky@pgr_test__db__test DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2021-01-17 09:05:24.777 CST [19237] vicky@pgr_test__db__test HINT: In a moment you should be able to reconnect to the database and repeat your command.
Expectation
No server crash
Solution
I suspect it was because the code is using a singleton which creates a pointer only once, but when the process ends, it loads a different instance and the pointer do not match to the new instance.
Remove the singleton and use something different.
Sample Data
pgRouting's sampledata
The text was updated successfully, but these errors were encountered:
Problem
Server crash
To Reproduce
I was experimenting with what would happen if the code of the vrp functions were executed from a different extension name, this experiment is to look forward to move the vrp functions to a public different repository
So, I created a pgRouting extension and a vrpRouting extension with exactly the same code of pgRouting
and on the vrpRouting extension I ran:
this is combines pgRouting and vrpRouting
Which generated a server crash.
The way it generated the server crash was as follows:
For simplification:
pgtap test = pgtap test with one or more queries that combines the 2 extensions
test = a pgtap test can have or can not have a query that combines the 2 extensions
Ran a pgtap test without problems, but when the next test started the server crash happened.
Expectation
No server crash
Solution
I suspect it was because the code is using a singleton which creates a pointer only once, but when the process ends, it loads a different instance and the pointer do not match to the new instance.
Remove the singleton and use something different.
Sample Data
pgRouting's sampledata
The text was updated successfully, but these errors were encountered: