nurpax / nurpawiki

Automatically exported from code.google.com/p/nurpawiki
GNU General Public License v2.0
0 stars 3 forks source link

[todo:nn foo] for an inexistant nn causes a server crash #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Bug report from Stephane Glondu:

We've noticed that putting a [todo:nn TODO item] with a number which
does't exist makes nurpawiki crash (hopefully, ocsigen itself is still
fine). I've not yet investigated on how to fix the bug, I didn't even
try the svn version (I am using version 1.2.0, plus the patch I've sent
you for ocsigen 1.0.0RC1).

Original issue reported on code.google.com by jjhel...@gmail.com on 17 Mar 2008 at 7:44

GoogleCodeExporter commented 9 years ago
Fixed in r413.

The server became unresponsive as one of the SQL queries failed a foreign key
constraint and started to fail subsequent transactions.

2008-03-21 18:31:58 EET ERROR:  insert or update on table "todos_in_pages" 
violates
foreign key constraint "$1"
2008-03-21 18:31:58 EET DETAIL:  Key (todo_id)=(2) is not present in table 
"todos".
2008-03-21 18:31:58 EET STATEMENT:  BEGIN;
         DELETE FROM nw.todos_in_pages WHERE page_id = 1;INSERT INTO
nw.todos_in_pages(todo_id,page_id) values(2, 1);INSERT INTO
nw.todos_in_pages(todo_id,page_id) values(1, 1);COMMIT

The fix was to not insert/delete inexistent todos into/from this relation.

Original comment by jjhel...@gmail.com on 22 Mar 2008 at 8:28

GoogleCodeExporter commented 9 years ago
Note: the server shouldn't go into a unresponsive mode even if something like 
this
happens.  Perhaps this should be remedied by doing a ROLLBACK if any of the 
commands
inside the txn failed.

Original comment by jjhel...@gmail.com on 22 Mar 2008 at 8:32