You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The UpdateApp method on EurekaConnection starts a goroutine that periodically unmarshals a new Application value, and then assigns it wholesale to an Application that represented the previous version of that Eureka application.
Per my note in file net.go, such assignment is not safe without either synchronization or use of atomic store and load operations. It's possible for a goroutine reading the Application value submitted to UpdateApp to observe a corrupted value. Per The Go Memory Model,
Reads and writes of values larger than a single machine word behave as multiple machine-word-sized operations in an unspecified order.
Since we can't orchestrate all the reads of the Application value submitted to UpdateApp, I suggest instead that UpdateApp offer a single-valued buffered channel from which interested clients can receive updates.
The text was updated successfully, but these errors were encountered:
Now that #37 is merged, should we consider deprecating the UpdateApp method?
That would involve a change to the documentation, as we'd have to leave the method in place to avoid stranding existing callers.
Yep, we'll definitely want to leave that method in place, but the example in the readme should be updated as well as the documentation for that method in connection.go
The
UpdateApp
method onEurekaConnection
starts a goroutine that periodically unmarshals a newApplication
value, and then assigns it wholesale to anApplication
that represented the previous version of that Eureka application.Per my note in file net.go, such assignment is not safe without either synchronization or use of atomic store and load operations. It's possible for a goroutine reading the
Application
value submitted toUpdateApp
to observe a corrupted value. Per The Go Memory Model,Since we can't orchestrate all the reads of the
Application
value submitted toUpdateApp
, I suggest instead thatUpdateApp
offer a single-valued buffered channel from which interested clients can receive updates.The text was updated successfully, but these errors were encountered: