Closed dhalperi closed 9 years ago
dependency management is hard :P.
Oh yeah, callback hell and asynchronous IO bites again. I thought this was resolved by https://github.com/uwescience/myria-web/blob/master/appengine/js/graph.js#L7 Draw should not be called until the call finishes. The callback is only called after the request is completed. This is odd.
You are obviously right, and I've realized the bug is completely something else. Thanks for the explanation though!!
In other news, my claim that this is non-deterministic was also false. I am just wrong today...
@domoritz thoughts appreciated.
I occasionally see this log in the Javascript console:
Uncaught TypeError: Cannot read property 'numTuples' of undefined graph.js:775
Tracking this code down, it seems that the
linkOrigins
dict is populated (comes from the query plan), but thelinkAttr
dict is not.linkAttr
is populated duringloadCosts
, which is called very early -- uponGraph
creation.The main thing I see is that
loadCosts
populateslinkAttr
usingd3.csv
, which is an asynchronous call. So it seems that if this call takes a little while,linkAttr
may not be ready when we get to the code that fails.One solution is to switch to jQuery for loading this data and force synchronous loading (and conversion from CSV). This change would make
loadCosts
a blocking function and add a critical section to the entire page.Opinion and alternate suggestions?