Bug #49099 network_address_set_address should be reentrant (mt-safe)
Submitted: 25 Nov 2009 13:06 Modified: 9 Jan 2015 10:34
Reporter: Dyre Tjeldvoll Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Proxy: Core Severity:S4 (Feature request)
Version:0.7.0 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[25 Nov 2009 13:06] Dyre Tjeldvoll
Description:
network_address_set_address()->network_address_set_address_ip() calls gethostbyname() which is not reentrant. This means that an mt-plugin must guard all calls to network_address_set_address() with a mutex. Which is doable, but somewhat inconvenient.

How to repeat:
Create mt-plugin with multiple threads which call network_address_set_address(). 

Suggested fix:
If proxy itself decides to go mt gethostbyname will probably have to be changed to gethostbyname_r.