(Port) Improve update ordering
We experienced a downstream issue where graph updates would non-deterministically segfault on macOS at mysterious places. After further investigation, the issue appears to be caused by the timing of updates. Specifically, if a node took a trivial amount of time to run, the timestamp sent by notify_output_ports_
and the subsequent update_output_ports_
would be identical. As a result, the target input port would reject the queued result because it wasn't newer than the timestamp of the notification. In the original issue above, this meant that the target node never received its value (a smart pointer) which ultimately produced a bad access to a nullptr. Whoops!
This issue has been mitigated in !12 (merged) by switching to a per-port, monotonic tick rate instead of a timestamp. I'm not convinced that I've implemented this correctly, though, so I'm opening this issue for awhile so it isn't forgotten.