You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2019/12/26 00:03:57 UTC

[GitHub] [incubator-dolphinscheduler] samz406 opened a new issue #1580: Problem creating session logic

samz406 opened a new issue #1580: Problem creating session logic
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1580
 
 
   
   
   **Describe the bug**
   Writing UT found that SessionService.createSession () creates a new session that will query all user sessions, but will keep the first one and delete others. If the first session ip and userId are exactly the same as the one created, the success will occur There will be two session data for the same ip and userId. The logout is queried by ip and userId.
   Session session = sessionMapper.queryByUserIdAndIp (loginUser.getId (), ip);
   The method just returns a piece of data, and the actual result database has two pieces of data, which will cause an error.
   
   写UT发现,SessionService.createSession()新建session会查询用户所有session,但是会保留第一个,其他删除,假如刚好保留的第一个session ip,userId和创建session的一致,创建成功会就会出现相同的ip,userId会有两条session数据,注销是通过ip和userId去查询的,
   Session session = sessionMapper.queryByUserIdAndIp(loginUser.getId(),ip);
   方法只是返回一条数据,实际结果数据库有两条数据,这样就会报错。
   
   **Which version of Dolphin Scheduler:**
    -[1.2.0-preview]
   
   **Requirement or improvement**
   
   When creating a session, first delete the session with the same userid and ip, and then create a new session. The purpose is that the userId and ip of the two session data cannot exist in the database.
   在创建session时,先删除userid和ip相同的session,然后再新建session,目的是数据库中不能存在两条session数据的userId和ip相同。
   
   
   If the suggestions are ok, I can modify
   
   如果建议没问题,我可以修改
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] samz406 commented on issue #1580: Problem creating session logic

Posted by GitBox <gi...@apache.org>.
samz406 commented on issue #1580: Problem creating session logic
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1580#issuecomment-574506161
 
 
   support k8s ,use userId check.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] dailidong commented on issue #1580: Problem creating session logic

Posted by GitBox <gi...@apache.org>.
dailidong commented on issue #1580: Problem creating session logic
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1580#issuecomment-569936813
 
 
   good idea thanks, welcome to submit a pr to resolve this issue.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-dolphinscheduler] samz406 closed issue #1580: Problem creating session logic

Posted by GitBox <gi...@apache.org>.
samz406 closed issue #1580: Problem creating session logic
URL: https://github.com/apache/incubator-dolphinscheduler/issues/1580
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services