gunicorn
gunicorn copied to clipboard
why gthread worker connections counter "self.nr_conns" doesn't need a lock ?
in gunicorn.workers.gthread.py
In order to avoid race condition, self.nr_conns -= 1 need a lock for protection or self.nr_conns need to be an automic integer?
...
fs.add_done_callback(self.finish_request) # this mean "finish_request" will be execute in main thread or child thread?
...
def finish_request(self, fs):
...
self.nr_conns -= 1 # race condition?
....
related issue
#2041