yi gong created Bug WELD-1418
Issue Type: Bug Bug
Affects Versions: 2.0.0.Final, 1.1.12.Final
Assignee: Jozef Hartinger
Components: Servlet Container Support
Created: 27/Apr/13 12:14 PM
Description:

There's a race condition in AbstractConversationContext when create first conversation scope if it's the first request of one session.
Suppose such scenario

  1. User request a jsf page
  2. weld create a conversations map in the AbstractConversationContext.associate()
  3. Because it is the first request, there's no session. Weld keep this map in request
  4. Then somewhere, a session is created
  5. In the render phase, server sends piratical response back. The page need some jsf resource, eg, jsf2 ajax or resource
  6. Browser request the new jsf resource
    At this time
    The first request has not finished. So it doesn't reach dissociate() and doesn't put conversations map in the session.
    Meanwhile
    The second request reach associate(). There's no conversations map in the session, and the session is existing. It puts its new map! <====

Then, even the first request finishes it's response and reach dissociate(), because there's already a map, it doesn't put its owner anymore. <====

A quick and dirty fix is always create session before associate(). However, it's better to merge the map in the dissociate()

Such page reference a conversation scoped bean

Environment: Tomcat 7 + JSF 2.1.2 + weld servelet
Project: Weld
Priority: Major Major
Reporter: yi gong
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira