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
Production()/Development() is not thread-safe (and more generally ClientManager will have inconsistent results if switching between Development/Production)
#95
Closed
froodian opened this issue
Oct 11, 2017
· 1 comment
Called client.Production() / client.Development() on clients return from ClientManager.Get
Expected no data race
Had "data race detected" from a test, between the line in my code calling client.Production() and apns2/client.go:156 (url := fmt.Sprintf("%v/3/device/%v", c.Host, n.DeviceToken))
The text was updated successfully, but these errors were encountered:
froodian
changed the title
Production/Development is not thread-safe (and more generally ClientManager will have inconsistent results if switching between Development/Production)
Production()/Development() is not thread-safe (and more generally ClientManager will have inconsistent results if switching between Development/Production)
Oct 11, 2017
I solved this by just keeping a ClientManager full of production clients and a ClientManager full of development clients, I feel like that's a fine solution and removes the ambiguity if another thread is sending on the client when you try to switch gateways, so I feel like that's a good answer to this, closing. Sorry about the noise.
client.Production()
/client.Development()
on clients return from ClientManager.Getclient.Production()
and apns2/client.go:156 (url := fmt.Sprintf("%v/3/device/%v", c.Host, n.DeviceToken)
)The text was updated successfully, but these errors were encountered: