After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 724886 - GI has some kind of race condition in cachestore
GI has some kind of race condition in cachestore
Status: RESOLVED FIXED
Product: gobject-introspection
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gobject-introspection Maintainer(s)
gobject-introspection Maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-02-21 13:17 UTC by LRN
Modified: 2015-02-07 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Try to work around races in cachestore (1.57 KB, patch)
2014-02-21 13:17 UTC, LRN
rejected Details | Review
cachestore: Use "write new, then rename" pattern, not "write in place" (1.34 KB, patch)
2014-02-27 14:03 UTC, Colin Walters
committed Details | Review

Description LRN 2014-02-21 13:17:07 UTC
When building with -j, there's some kind of race condition in accessing
datacache.

I'm not sure what the right thing to do, but i've tried to work around it
by re-trying the open() call and sleeping for 500ms on failure.
Comment 1 LRN 2014-02-21 13:17:11 UTC
Created attachment 269913 [details] [review]
Try to work around races in cachestore
Comment 2 Colin Walters 2014-02-27 14:03:30 UTC
Created attachment 270475 [details] [review]
cachestore: Use "write new, then rename" pattern, not "write in place"

This should fix race conditions when multiple processes attempt to
access the cache concurrently.
Comment 3 Colin Walters 2014-02-27 14:04:49 UTC
Review of attachment 269913 [details] [review]:

I'm not going to apply patches that just add sleep() calls.
Comment 4 Colin Walters 2014-02-27 14:06:20 UTC
(In reply to comment #3)
> Review of attachment 269913 [details] [review]:
> 
> I'm not going to apply patches that just add sleep() calls.

Unless there is some actual investigation, and we find that on say some particular version of Windows, there is a bug that really requires it, and we will be *reliably* working around it.

An alternative patch is to just disable the cache store on Windows (or in general...)

But can you try my patch?
Comment 5 LRN 2014-04-01 07:48:09 UTC
I've completed at least one build without my 500ms-sleep hack (and without your "new then rename" patch, (with gobject-introspection-1.39.90).
Which may indicate that this bug was either fixed naturally (and my hack was unnecessary for some time), or just too difficult to reproduce.
Comment 6 LRN 2014-04-01 11:30:53 UTC
Review of attachment 270475 [details] [review]:

Patch looks ok, though i don't think i ever had problem with this particular piece of code.
Comment 7 Colin Walters 2014-04-01 11:35:46 UTC
Attachment 270475 [details] pushed as 5b10513 - cachestore: Use "write new, then rename" pattern, not "write in place"
Comment 8 André Klapper 2015-02-07 16:46:09 UTC
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]