Closed mkarklins closed 7 years ago
Thanks for the gist... simple-navigation has probably never been tested in a multithreaded high workload environment and it has never been an issue so far. Due to time constraints I would appreciate if you could investigate and contribute your findings. Thanks!
The way I got around the problem was to simply synchronise the execution across threads:
# initializer
class SimpleNavigationPatch
def self.mutex
@mutex ||= Mutex.new
end
end
# layout.html
SimpleNavigationPatch.mutex.synchronize { render_navigation }
This is not pretty and has performance penalties, but renders the navigation correctly. Since this is working now and doesn't seem like such a major problem, I'll probably won't have the motivation to dig deeper.
Guess we can close this now.
Ok, thanks for your feedback.
I have a rails app running in multiple threads. When the workload is high enough, the rendered navigation produces strange results - as if it had skipped few navigation elements.
I created a gist with reproduction steps here.
An example result is this:
Using simple-navigation 4.0.5
Could someone provide an insight on where lies the problem?