Skip to content

Instantly share code, notes, and snippets.

@fishcakez
Created October 14, 2015 19:05
Show Gist options
  • Save fishcakez/75720ec5c11b6cad519e to your computer and use it in GitHub Desktop.
Save fishcakez/75720ec5c11b6cad519e to your computer and use it in GitHub Desktop.
Race condition in GenRouter message protocol
source is a named process on different node to the sink
* sink sends ask to {:source, :source_node}
* source adds sink to its list of sinks
* source exits
* source supervisor receives :EXIT from source(1) and restarts the source, source(2)
* sink sends ask to {:source, :source_node}
* source(2) adds sink_pid to its list of sinks
* sink receives :DOWN from source(1) and assumes :eos
* source(2) sends events to sink
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment