Letractively / wro4j

Automatically exported from code.google.com/p/wro4j
0 stars 0 forks source link

Resource watcher doesn't invalidate cache when change detected for wro4j-grails-plugin #838

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Consider a group containing two resources:

group {
  js("script.js")
  css("style.css")
}

The script.js resource is changed. 
The request for /wro/group.js should detect the change. But it doesn't if there 
are two concurrent requests for /wro/group.css & /wro/group.js. When the 
/wro/group.css is requested first, the change is not detected. 
Apparently the cause for this problem is that resourceWatcher uses string  
representation of the group as a key in a map and completely ignores its type. 
This causes the problem in concurrent environment.

Original issue reported on code.google.com by alex.obj...@gmail.com on 30 Jan 2014 at 1:39

GoogleCodeExporter commented 9 years ago
Note: this issue can be reproduced when resourceWatcherAsync=true and 
resourceWatcherUpdatePeriod=5. 
I have reproduced it while running wro4j-grails-plugin and changing a single 
coffee script file.

Original comment by alex.obj...@gmail.com on 30 Jan 2014 at 3:44

GoogleCodeExporter commented 9 years ago
Fixed in branch 1.7.x

Actually, there was a problem with the 
DefaultSynchronizedCacheStrategyDecorator which have considered that a check 
was performed even if it wasn't. Fixed by returning boolean from 
ResourceWatcher#tryAsyncCheck.

Original comment by alex.obj...@gmail.com on 31 Jan 2014 at 12:28