View Issue Details

IDProjectCategoryView StatusLast Update
0000408Spring engineGeneralpublic2007-04-04 22:35
ReporterM2 Assigned Tojcnossen  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Summary0000408: [patch] Race condition with lua
DescriptionThis patch addresses some problems caused by the current logging design.

The main issue is only caused indirectly by the logger, when it outputs a message it also calls all listening subscribers. One subscriber uses lua and if called from outside the main thread it has a reasonable good chance to run in parallel with some other lua widget from the main thread, and thus crash the game.

The straightforward way of solving this would be to guard all public functions using lua with some locking mechanism. But this would create a lot of locking for the relatively few cases when lua gets used from outside the main thread. So instead all incoming log messages get cached and later invoked from the main thread, thereby avoiding race conditions inside lua.

Additional InformationThis can easily be reproduced by using the luaui and modifying the code to spam log messages from the server thread.
TagsNo tags attached.
Attached Files
logging.patch (Attachment missing)
Checked infolog.txt for Errors

Activities

tvo

2007-01-31 22:35

reporter   ~0000680

forgot to attach the patch?

trepan

2007-02-01 17:35

reporter   ~0000688

Thanks for finding this M2.
Fixed, with enhancements in SVN (r3373).

M2

2007-02-01 19:23

reporter   ~0000689

I apparently forgot to attach the patch to my original report and now you have fixed it, but you should still take a look at the patch because it also resolves some other small bugs.

trepan

2007-02-01 19:50

reporter   ~0000690

The LuaUI related bug is fixed, re-assigned to jc.

tvo

2007-04-04 22:35

reporter   ~0000864

AFAICS all chunks have been committed one way or another.

Thanks for your contribution anyway.

Issue History

Date Modified Username Field Change
2007-01-31 00:15 M2 New Issue
2007-01-31 22:35 tvo Note Added: 0000680
2007-02-01 00:05 trepan Assigned To => trepan
2007-02-01 00:05 trepan Status new => assigned
2007-02-01 17:35 trepan Note Added: 0000688
2007-02-01 17:35 trepan Status assigned => resolved
2007-02-01 17:35 trepan Resolution open => fixed
2007-02-01 19:23 M2 Status resolved => feedback
2007-02-01 19:23 M2 Resolution fixed => reopened
2007-02-01 19:23 M2 Note Added: 0000689
2007-02-01 19:23 M2 File Added: logging.patch
2007-02-01 19:50 trepan Note Added: 0000690
2007-02-01 19:50 trepan Assigned To trepan => jcnossen
2007-04-04 22:35 tvo Status feedback => resolved
2007-04-04 22:35 tvo Resolution reopened => fixed
2007-04-04 22:35 tvo Note Added: 0000864