Open hwchen opened 6 years ago
Oops, doesn't fix. Increasing the threads and the NilClass behavior returns.
Ok, so some modifications and it looks like nilClass has not returned.
Changing the reference from olap
to @@olap
in get_cubes_or_404
appeared to get rid of the last NilClass.
@jazzido @jspeis just wanted to start the conversation about patching the race condition on connection init.
As far as I can tell, this patch fixes NilClass errors that were occurring when there were near-simultaneous requests to MondrianRest.
Previously, constructing the connection and connecting occurred on the first api request. Since connecting took some time, there would be a moment when
@@olap
was no longer nil, but the new mondrian connection was not yet ready for use (resulting in, we think, theNilClass
errors).With this patch, now those initialization steps are done in the config.ru.
There's probably a better way to do this, so please let us know what you think @jazzido . This would be a pretty big breaking change if it had to be done in
config.ru