timeout logic causes logout when load balanced

Bug #1243277 reported by David Lyle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Low
David Lyle
Havana
Fix Released
Low
Kieran Spear

Bug Description

The session timeout code in the horizon/middleware.py can cause inappropriate timeouts/logouts when running Horizon behind a load balancer on two machines that are slightly out of sync time-wise.

Results in redirection to the login screen and Session expired error if not fixed.

Example with 3 minute time difference:
  import datetime

  timestamp = datetime.datetime.now()

  day_one = datetime.datetime(2007, 12, 5, 9, 1, 1)
  day_two = datetime.datetime(2007, 12, 5, 9, 5, 1)

  print (day_one - day_two).seconds
  print (day_two - day_one).seconds

  print abs((day_one - day_two).total_seconds()) // apparently no total_seconds in python 2.6
  print abs((day_two - day_one).total_seconds())

  print abs(day_one - day_two).seconds
  print abs(day_two - day_one).seconds

Output:
  86160
  240
  240.0
  240.0
  240
  240

David Lyle (david-lyle)
Changed in horizon:
assignee: nobody → David Lyle (david-lyle)
summary: - timeout logic causes logout when loud balanced
+ timeout logic causes logout when load balanced
David Lyle (david-lyle)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/53163

Changed in horizon:
status: New → In Progress
David Lyle (david-lyle)
description: updated
David Lyle (david-lyle)
description: updated
David Lyle (david-lyle)
description: updated
David Lyle (david-lyle)
tags: added: havana-backport-potential
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → Low
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-1 → icehouse-2
Revision history for this message
David Lyle (david-lyle) wrote :

This was fixed in a commit for the bp django 1.6 support.

https://review.openstack.org/#/c/58947/

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/66253

Kieran Spear (kspear)
tags: removed: havana-backport-potential
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/70016

Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-2 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.