From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 66797A00C5; Wed, 14 Sep 2022 15:15:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5477C4021D; Wed, 14 Sep 2022 15:15:50 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 2004940156 for ; Wed, 14 Sep 2022 15:15:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663161349; x=1694697349; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=jd8hfFOiaDkhw9KKHW42grexmD3QvuFXZA2EDTXrIBQ=; b=VWoWTPVxwEO21gG4CC6qIYCCt38ZdfHFdwlHloig+0EbBSMg3zudHHUb W9Y+b/30T6qoU3wRfEZQoNQvUDKSEK/Cp/PnJ+YRYdSYKQrudGQ694GMw MdoVHicIifxFAZ3IMCJt0PBC4sT7i6JKJxkWeFJ2TiUelTrO8KDjx2qUa tW4F3GZL5+QAgBaEZx6aVWyrY3Z5RnG74BL7ZFGe61E2VMA9pBjzDwW7z fShTi/b/8RDKiDPTsHRPlVxztfkfIIydmp8iBDW3aYaMtKdQh06NjEfg7 gJcZRKs1HpMcxlo2rN8uGA2jRyvG16y4xLQH9ekfTf3Dt3vSLLwjmYmg8 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10470"; a="324678493" X-IronPort-AV: E=Sophos;i="5.93,315,1654585200"; d="scan'208";a="324678493" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2022 06:15:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,315,1654585200"; d="scan'208";a="616860736" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 14 Sep 2022 06:15:47 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 14 Sep 2022 06:15:47 -0700 Received: from fmsmsx608.amr.corp.intel.com (10.18.126.88) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 14 Sep 2022 06:15:46 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx608.amr.corp.intel.com (10.18.126.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Wed, 14 Sep 2022 06:15:46 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.104) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 14 Sep 2022 06:15:46 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=imf0NTICnswjMf0PNKHQBOSG3OD17sTIM6BETv5+qnHnDrfh80ohhEJxfDr3TzPyg1xK5qtt2fCPtTXqJxd/42sno2G05zcYP8tuirRLFKLbpUwfjn9kcQ0bvBXMX6N3m3sP8tzvUz+6e5/SnSSgxeNqYVcvOxsck5P1lnM03RNIpFVaER+TZiknr11uNVOj6KKuxFEDjeSM4gHExX3MeWWPGAITR+/QjnHv6qhJDOEe1vKV2iFb7EaDczk8ZmkEM22ZK69ZD1kB4sm2AxZPHixOq8J/ozrkTnfTMgnwBfheSqVYejuiBXqltFRimy/a4akSb7Wh4zcMXWATEkof0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HosN/XB2+x41bCQxt5ZbLJ5OhybL1qgTdj2f4yGS1AU=; b=F5z0L9JG7j4I+8MW6QiGh0k5w1Zi60gg1YET0OzHZ5XkfEf72YM3hWtT/LERYE3sC6MSaLw2u6f6W5ICr9qUUMikS1pPxzLBYChdRWgOCyqyH2aFZNT3njtTk8K3kFm+al0HPMleSluP/lm7QZwViFTIqvj5ygPpYwylISeNC4bNZ5CycmPayX+rb9gonT+F4jtjZDddRrTDos0sou1H7KkLWHpoVpaZDzczZ/urkkGjbKwC1o/RbRXpmbdJr4NrZa8TJubty0EqeLTLDKmPOazfT16jsV6Q8pc+OC3GWYMVibtxlYu2cIXmb1ieZspb5hqhNo155iTXw1mmFnFpAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by SJ0PR11MB4910.namprd11.prod.outlook.com (2603:10b6:a03:2d7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.22; Wed, 14 Sep 2022 13:15:44 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::13c:8120:d994:16d2%6]) with mapi id 15.20.5612.022; Wed, 14 Sep 2022 13:15:44 +0000 Date: Wed, 14 Sep 2022 14:15:37 +0100 From: Bruce Richardson To: Owen Hilyard CC: Juraj =?utf-8?Q?Linke=C5=A1?= , "Thomas Monjalon" , David Marchand , , Honnappa Nagarahalli , "Tu, Lijuan" , dev Subject: Re: [PATCH v4 5/9] dts: add ssh connection extension Message-ID: References: <20220728100044.1318484-1-juraj.linkes@pantheon.tech> <20220729105550.1382664-1-juraj.linkes@pantheon.tech> <20220729105550.1382664-6-juraj.linkes@pantheon.tech> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DB6PR0301CA0026.eurprd03.prod.outlook.com (2603:10a6:4:3e::36) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|SJ0PR11MB4910:EE_ X-MS-Office365-Filtering-Correlation-Id: 664a0ecc-d73b-4dd6-6f20-08da96533ab4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yeG1fUBcmQyr6FscH7fsjvBbmZdLHf6uhNuSHvfOu+iAdVQ77sk75ZjOlma1BZaTpqw7Mp/Xc3dwwO6AmETRrIFk+paguzefqlWtXI1Hi6f8w80xFIMcGsqGq+K2lISx16RyLbCPj/zpzBiyj/410QAEaMzfGFPnCkaPtA9OBZM9po6i+LV71E2QViLx9tnANQ3gQXrAnXpJY6WfJnJ4+BPCyM43bEnDnVYpW7ptkIW4QhmSp1DMK6ojZpsSSVGoG9Vg6UEHF9ovtMR8Sen2zovHiPz4uYF1YC552ds5VrO+havcSrcX7rtiTy3SQWK98znzFL1F7p2/Bjl5bQyZo7LJESqiscHqSLueJLSVJ8t9t1fpjDus18w+tT86h+reb3cgnJr939pczd6pry5nUBpVFCFSNy44HhZ0yatIKXiEaR/fyDpw0qfDYmDK3dDXSssPCSFcTtVne1DxV7ZLWOvasZt3FTnEbD/PRWc/6ys0/kvc8aEJsahxyUbks8FfvYPzyYbnCChCC32LlgFQ4Vk6fFfpXL3PJI9+qfNiiMy6jqyTFC39K0J3i0o9pUrsdnthpqAKHYawacuh7exDsDa8kg+XyurEQkiUXFfJ49KuP1AYhP4TNciVJP6v1YOJHVQ/li2/c48ZEitqXjVEm201EwbXPpVoZR3UrLSwfHNnuRQ2S+s9/a5R+5YJep/At9j7G/Kh5ft16Rmll1LQYwMBM7HXx38jBm146SqdKGAOtph3MNSz8BFD569kVydMWtKreUxjxiJs6MDprqMEvA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(136003)(346002)(376002)(39860400002)(366004)(451199015)(478600001)(54906003)(6916009)(316002)(6486002)(66476007)(8936002)(2906002)(53546011)(6506007)(8676002)(82960400001)(44832011)(38100700002)(6666004)(6512007)(41300700001)(4326008)(66556008)(26005)(5660300002)(66946007)(186003)(86362001)(83380400001)(67856001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NnNhOWZ2QVA0bE52M2MvcDlrWWo3bXByY1lFNGxKc2ZPRmpSQTNwT2RGMmto?= =?utf-8?B?dWhuTXdFcHFUMmdtbHhQbTM0cnJOTnVVc2xZbGZsRTFQQzFDU3ptQnQ0OHdn?= =?utf-8?B?U0VmM0xlT3BTUGpYNFBrUlVVZ3ZGbk1oQnVmV3huSW1QSzBNbTkwNTdUZEdT?= =?utf-8?B?TXJmcGJ0WjcyWTU2c3BjWm5mNGlsMVFsVzVVTnBEdFFLWHM4UnFpTkc0VEVh?= =?utf-8?B?WVZRaHRZNmc4N0R3SlgvQ0NuYkQ3WW5FMEgzMElXVHFJL0JIQktkbXlDbzhM?=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Ribld2OFBkM3dKMi84RzNVV0VC?= =?utf-8?B?d1lDNmhZRHdPWDRXRXFSVmk2bjBkcnpvR1ZVZ0JTYXE3RlZYOHdKNnlqRTNW?= =?utf-8?Q?f8YKu1bByfiEavTYGwfefhQ=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 664a0ecc-d73b-4dd6-6f20-08da96533ab4 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2022 13:15:43.9108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: no5Avt/kvf/d6JJHgUFu2c86OrbHk7aKL8uRPxgvAemsHt+VFo5P+znhyWn2gT61J6dg5PlKpw5aKobdBiAnxsSLHN1XUiBZjYgCmq16JGw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB4910 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Wed, Sep 14, 2022 at 08:02:37AM -0400, Owen Hilyard wrote: > On Wed, Sep 14, 2022 at 3:46 AM Bruce Richardson > <[1]bruce.richardson@intel.com> wrote: > > On Fri, Jul 29, 2022 at 10:55:46AM +0000, Juraj Linkeš wrote: > > > The class adds logging and history records to existing > pexpect > > methods. > > > > > > Signed-off-by: Owen Hilyard <[1][2]ohilyard@iol.unh.edu> > > > Signed-off-by: Juraj Linkeš > > > --- > > > dts/framework/ssh_connection.py | 70 > > +++++++++++++++++++++++++++++++++ > > > 1 file changed, 70 insertions(+) > > > create mode 100644 dts/framework/ssh_connection.py > > > > > > > One comment inline below. > > > > /Bruce > > > > Two questions on this function: > > > > * Is the getattr() check not equivalent to "if self.logger:"? > > > > It is. I missed it when looking over this code. I know that > this close > > function can run in a context where it loses the ability to > make system > > calls (an exit hook), but that doesn't matter for this as far > as I > > know. > > > > * Why the check for a non-none logger in this function, when > other > > > > functions above always seem to call the logger directly > without > > checking? > > > > "close" can be called before "init_log" if the program crashes > early > > enough, so this is avoiding calling a function on a null > object. No > > other function can have that issue because by the time control > is > > returned to the user the logger is properly initalized. This is > > especially important because an early failure in the community > lab will > > only be able to use logs to figure out what happened. > > > I'm a little confused by that explanation - can you perhaps clarify? > This > close function in part of an class, and the logger member is > assigned its value > in the constructor for that class, so how is it possible to call > obj.close() before obj has been constructed? > > Due to how we are forced to add the hooks to flush logger buffers to > disk before shutdown, even in the case of failures or SIGTERM, close > can run WHILE the constructor is in the middle of executing. All of the > resources except for the logger can be freed by python, but the logger > requires special handling, so we check if it is null and then flush the > buffers to disk if it is not. The actual logger object is only assigned > to self.logger after it is completely initalized, so if it's not null, > then it is in a good state and can be safely flushed. Here's a sequence > of events that would lead to that check being needed: > 1. Start constructing logging handle > 2. Execute first line of the constructor > 3. SIGTERM > self.logger == None, since the entire world stops and moves to the > cleanup functions registered with the interpreter. If we don't do this > check, then the cleanup context crashes in this case. > Ack. Thanks for the clear explanation, having the check now makes sense.