request->username_hash);
errormsg = director_request_get_timeout_error(request,
user, str);
+ if (user != NULL &&
+ request->delay_reason == REQUEST_DELAY_WEAK) {
+ /* weakness appears to have gotten stuck. this is a
+ bug, but try to fix it for future requests by
+ removing the weakness. */
+ user->weak = FALSE;
+ }
array_delete(&dir->pending_requests, 0, 1);
T_BEGIN {
{
time_t expire_timestamp = user->timestamp + dir->timeout_secs;
- return expire_timestamp >= ioloop_time;
+ if (expire_timestamp >= ioloop_time)
+ return TRUE;
+
+ if (user->kill_state != USER_KILL_STATE_NONE) {
+ /* don't free this user until the kill is finished */
+ return TRUE;
+ }
+
+ if (user->weak) {
+ if (expire_timestamp + USER_NEAR_EXPIRING_MAX >= ioloop_time)
+ return TRUE;
+
+ i_warning("User %u weakness appears to be stuck, removing it",
+ user->username_hash);
+ }
+ return FALSE;
}
static void user_directory_drop_expired(struct user_directory *dir)