﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29846	Signals - handling multiple requests concurrently	Anomitra Saha	nobody	"I am using a `pre_save` signal to store the user who performed the last operation on a particular instance.

To achieve this, I'm using a middleware. In the `process_request` function of it, the signal is registered with the appropriate function, `set_user` as shown below.

    mark_who_did = curry(self.set_user, user)
    models.signals.pre_save.connect(mark_who_did, dispatch_uid=(self.__class__, request,), weak=False)

Then, I'm disconnecting this signal in the `process_response` function of the middleware.

    models.signals.pre_save.disconnect(dispatch_uid=(self.__class__, request,))

This works fine when concurrency is not involved. However, suppose we have three concurrent requests - the signal is connected three times, and the `set_user` method is invoked **nine times**, for each user-request combination.

As per my understanding, each request should have been operating independently, but that is obviously not the case. Is there something I'm missing, or is there something I could change in my code to fix this?"	Uncategorized	closed	HTTP handling	1.11	Normal	invalid	signals		Unreviewed	0	0	0	0	0	0
