Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp773450ybt; Fri, 10 Jul 2020 12:01:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNx65ddr+Hw1NgdTJoNhXlbN2arHQIFtXk/8GYNnzM2CJRhkG5Uh55bGLm7QoE90zDE32a X-Received: by 2002:a17:906:3e84:: with SMTP id a4mr59798233ejj.372.1594407696951; Fri, 10 Jul 2020 12:01:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594407696; cv=none; d=google.com; s=arc-20160816; b=DpTTAwtLpjNisYiy3FhGK0jMF1T8Bvge/Af7E8qV8ipw5xvTwek0rIBMpuN3Pdn/Fb 1rwsbRoiYJss9too8rDR5ZpNQyvh9+EC86QtRX5bJx/Q0/ENrNQrbFY9uA2F7ed+vUjN N6CVsdCyvfRX/d1m0vxtkG1tXCP6NBTFOBoiRJ1cwtpX9sgicCXuLDyEhd3ecyqYqFWX YoiVBNycZHTLbwRs6wqb44QLTKjcEHwKzFbG1m1nLOPRM9gQuh3vvryEcVS2krA5xhzq Z3vHRosklNiOjyhQQKoMbTjde95SZdgaEEz0yToWrUDihOQihLJ93eItgl2434ww/8y6 2tAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=IY6VZIxYpuKsdIHEjTYnwkcGoaOC6zICwGC7mMdrNTo=; b=ZqZ0IEa5I5FnSk/YqpJ603Oh9IHQTMJx6aHMeAZtQwsujAdoaqc24ynA2AjM4RI6S7 ysyuwi6PunvPwUTEWucFCRboIhr1fQjeSG+81eiC6fEXJoDZYDTapkTjtzfrdXTbii+W 92M9PyULFjW+Pe6BVcM/7gvTv180uUJC/CFDyDlnTbj6SZIRJkGnhNP/EvQeBhwf9nwq GYgJHgXkXN65M1Xyp0+ooZlxsACL1xKurZKyVU9cuws56vzcNcGiJK9B9QUSfN3dsasi C+RR4t6dRrBb1A2WGEZpxSH5V+qRWP22Acl+DcVIaGKoUi9pXELIrPxcJcwsgcCYKSQ7 1Ynw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r13si4517580edq.209.2020.07.10.12.00.45; Fri, 10 Jul 2020 12:01:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727091AbgGJTAm (ORCPT + 99 others); Fri, 10 Jul 2020 15:00:42 -0400 Received: from relay12.mail.gandi.net ([217.70.178.232]:38861 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726872AbgGJTAl (ORCPT ); Fri, 10 Jul 2020 15:00:41 -0400 Received: from classic (lns-bzn-39-82-255-60-242.adsl.proxad.net [82.255.60.242]) (Authenticated sender: hadess@hadess.net) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 91AED200003; Fri, 10 Jul 2020 19:00:35 +0000 (UTC) Message-ID: <3f9aeb5d7aa896770946a8c04bd8483e9d7ba4f3.camel@hadess.net> Subject: Re: Temporary device removal during discovery From: Bastien Nocera To: Luiz Augusto von Dentz Cc: Andrey Batyiev , linux-bluetooth Date: Fri, 10 Jul 2020 21:00:35 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.3 (3.36.3-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Fri, 2020-07-10 at 11:06 -0700, Luiz Augusto von Dentz wrote: > Hi Bastien, > > On Thu, Jul 9, 2020 at 1:26 AM Bastien Nocera > wrote: > > On Thu, 2020-07-09 at 01:57 +0300, Andrey Batyiev wrote: > > > Hi Luiz, > > > > > > On Thu, Jul 9, 2020 at 12:14 AM Luiz Augusto von Dentz > > > wrote: > > > > The delta logic might be a nice addition as a separate patch, > > > > it is > > > > more for detecting devices disappearing then actually cleanup > > > > during > > > > power off. > > > No-no, it's not about adapter powering off. > > > > > > I meant that (external) devices never disappear from the bluez > > > device > > > list during the discovery, > > > even if the (external) devices are turned off (i.e. they should > > > be > > > purged by bluez). > > > > > > So: > > > - bluez is central > > > - bluez is discovering > > > - peripheral appear for a moment, than disappear (i.e. peripheral > > > would be turned off) > > > - bluez would not remove device from the list (at least until > > > discovery is stopped) > > > > > > Use case: > > > - bluez is monitoring environment (discovering literally forever) > > > - peripherals are brought in and out of bluez visibility range > > > - bluez list of visible devices grows infinitely and causes > > > problems > > > (hundreds of devices) > > > > I'd also expect devices that are recently discovered to disappear > > if > > they haven't replied to a discovery in 30 seconds. It would stop > > GNOME's Bluetooth Settings's Bluetooth list forever expanding. > > > > Or we need to give the ability for front-ends to do that by > > exporting > > the "last seen" dates. > > I am fine with that as well, 30 seconds doesn't sound too bad even > for > cleanup temporary devices as the current 3 minutes seems awful long > sometimes, we could perhaps have a filter for configuring that though > so if the application wants to have its own timeout, the only problem > is if there are multiple application doing that on parallel we would > need a strategy on how to handle that. In which case it might be easier to export that last seen date, otherwise that's just a lot of moving parts inside bluetoothd when we could filter it trivially in the front-ends.