From dev-return-15491-archive-asf-public=cust-asf.ponee.io@syncope.apache.org Thu Apr 12 17:58:05 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0F8B618067B for ; Thu, 12 Apr 2018 17:58:04 +0200 (CEST) Received: (qmail 77789 invoked by uid 500); 12 Apr 2018 15:58:04 -0000 Mailing-List: contact dev-help@syncope.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@syncope.apache.org Delivered-To: mailing list dev@syncope.apache.org Received: (qmail 77778 invoked by uid 99); 12 Apr 2018 15:58:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Apr 2018 15:58:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 8A16DC0249 for ; Thu, 12 Apr 2018 15:58:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -110.311 X-Spam-Level: X-Spam-Status: No, score=-110.311 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id z6X6V2sZjEVJ for ; Thu, 12 Apr 2018 15:58:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id E016D5FBC2 for ; Thu, 12 Apr 2018 15:58:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id D6719E0C26 for ; Thu, 12 Apr 2018 15:58:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 423AD241C8 for ; Thu, 12 Apr 2018 15:58:00 +0000 (UTC) Date: Thu, 12 Apr 2018 15:58:00 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@syncope.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SYNCOPE-1301) Token creation is not threadsafe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SYNCOPE-1301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16435830#comment-16435830 ] ASF GitHub Bot commented on SYNCOPE-1301: ----------------------------------------- Github user IsurangaPerera commented on the issue: https://github.com/apache/syncope/pull/70 Yes, that's why we have to see it from a different perspective. The initial state doesn't change the logic of replaceExisting == true But it partially affects replaceExisting == False (This affects only if the thread safe problems occur). This means when the issue syncope-1301 occurs instead of creating a new token for the same user this will replace the existing one (rare situation) > Token creation is not threadsafe > -------------------------------- > > Key: SYNCOPE-1301 > URL: https://issues.apache.org/jira/browse/SYNCOPE-1301 > Project: Syncope > Issue Type: Bug > Components: core > Affects Versions: 2.0.8 > Reporter: Isuranga Perera > Priority: Major > Fix For: 2.0.9, 2.1.0 > > > Token create method in AccessTokenDataBinderImpl[1] is not thread safe. This could result in several problems including > * Exist 2 different access token for a particular user at a given time which may result in an exception thrown by method call[2] since it expects a single token a given user. > In addition to that token replace is implemented as a combination of 2 different functionalities. Since the method is not thread safe this may cause some unexpected behaviors (since there can be 2 tokens exist for a particular user. same scenario as above). > [1] [https://github.com/apache/syncope/blob/master/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java#L104] > [2] [https://github.com/apache/syncope/blob/master/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/AccessTokenDataBinderImpl.java#L113] -- This message was sent by Atlassian JIRA (v7.6.3#76005)