councilforeconed / interactive-activities

Council for Economic Education
http://interactives.councilforeconed.org
Mozilla Public License 2.0
6 stars 2 forks source link

Pizza productivity: Dancing tomatoes #156

Open cbujara opened 8 years ago

cbujara commented 8 years ago

Tomato sauce blobs simulate brownian motion in the ingredient tray. See attached video. Possible cause: we were attempting to figure out if issue #154 was related to two chefs grabbing the same pizza from the work queue at the same time. Testing local instance of bocoup-2015 branch on 4 different machines. This happened once a couple of months ago on a different machine when testing production, but we dismissed it as a fluke. Can't think of any way to reproduce. IMG_4100.m4v.zip

jugglinmike commented 8 years ago

@cbujara Your video describes a sort of thrashing where the server is constantly re-assigning the same pizza between two players. (The globs of sauce seem to dance because we re-render the ingredient tray's contents (placing them randomly) every time we assign a pizza.) Your steps to reproduce were accurate; it's just that triggering the so-called "race condition" is a little hit-or-miss. I've just submitted a fix via gh-158.

cbujara commented 8 years ago

We tested the heck out of the simulation on Friday with no problems, but alas, the mysterious dancing sauce recurred on one workstation this morning. We were testing in round 4 with 3 people on 4 devices, with 1 person doubling as 2 chefs (4 chefs total), in our development environment, running a bocoup-2015 branch build incorporating all pull requests to date. The chef who experienced the problem began the round switching their workstation from dough to sauce in preparation for collaborating, which immediately triggered the problem. Simultaneously, another chef was trying to grab a plate from the production line to put some dough on it, but was unable to drop the plate on the worktable. Once the problem started, none of the other chefs were able to grab any pizzas from the production line or perform any work, though their ingredients were behaving and staying still. We tried to recreate the problem several times, with no luck. Perhaps you can spot something in the workstation switching code that could create a race condition?

jugglinmike commented 8 years ago

While I'm disappointed to learn that we haven't licked this one yet, I'm very happy to have all this information! Thanks for that, Chris: I'm on the case (again)

jugglinmike commented 8 years ago

I've been unable to reproduce this bug, and I can't find anything in the source that would explain it. (For the record: I think workstation switching may be a red herring, since the client does not inform the server of its location.)

I'm going to table this for now in the interest of making headway on some of the other open issues.

cbujara commented 8 years ago

Good call, Mike. We've been doing our best to pin down the precise circumstances under which it occurs, and have even been recording screens during our test sessions, but of course, when you're watching for it, it doesn't happen.