Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp826466ybt; Fri, 10 Jul 2020 13:28:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxxXGxYKRWsVBSSqKGSPYepssHUkh+60/fkPk7nyBkRC+c8ZozLwxpVRpEzoYZnr8TYY8WH X-Received: by 2002:a17:906:8392:: with SMTP id p18mr66379434ejx.24.1594412888821; Fri, 10 Jul 2020 13:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594412888; cv=none; d=google.com; s=arc-20160816; b=Drmp+Oi9IZ35md+TDx/6BKRdyc+tV0SsN9hBgn8Iehov4QtRLXxLMC3SWKkHPLpu2o lJTJt2dyU0v/Jsr3Sgxsrp5B8KUc8NOu5cph3uZqZt1jMH1hJuWJVsyj4RVQWObWpz9q HtekDEbc85ox/YRHE2yJgf+xF6zyrJCHWfvTTU9JBYLnKHb3cKl2XIPB7uHQ9XLOxv4c VHBVfhH7AEllwdyi9qvlxdXpp3e/RyL58pULhkBIT1yvpnWFIDC4ulQ1MdyC9pTLXhY2 +0MjoXHBo3GlvrfHBW1MP5EyBxG1fNdqUCidVGeAxvGbZd7yreHpqMf9bEfratUUkG1c +8pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=GlueREa58b7R7VgL4TssSAMNWNyU4cNA/gxFnLfVl+c=; b=McGQ6f21rFUfSZxDAY8ckAn+VQjSGsMNqiemrPPdcwV5CWs7yxiEnxoRYrJWk8MU7K Kh8unR8EhgNVQGU3SM9kRO4p/iXB+1OKCKH8L2dSV/4gemrPDFzV9TytiVf7RnhAWQh6 iQofp2NshytV8oSTUXwz6xsmhkBuRtcuGjbw9QcDqd7AOEHhjSf9hFw1BHcvxUG1VbKO QITus4KMmK4Ug6Q/XUBgVGHQFdUcDB9jKaLP2Bhtftnq+GGsmakn310LR6bBEfDKVyfg XBBl8tPVfeAS68CKKgRietX2mTFhMhMcy09fACRKHkRcIMimzJcII1L8EX91W2WlBZ7v F1ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HVBBdLnX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n26si4398843ejs.214.2020.07.10.13.27.23; Fri, 10 Jul 2020 13:28:08 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HVBBdLnX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726867AbgGJU1S (ORCPT + 99 others); Fri, 10 Jul 2020 16:27:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726828AbgGJU1S (ORCPT ); Fri, 10 Jul 2020 16:27:18 -0400 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BD16C08C5DC for ; Fri, 10 Jul 2020 13:27:18 -0700 (PDT) Received: by mail-oo1-xc31.google.com with SMTP id p26so1236408oos.7 for ; Fri, 10 Jul 2020 13:27:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GlueREa58b7R7VgL4TssSAMNWNyU4cNA/gxFnLfVl+c=; b=HVBBdLnXBVyVmBkn+U8swcNvwrekcAUYiq9XAL/9Jx17Y/CEgfq1lwNp4dB/qhNYmR Nxk08EfnmjL8vG0XO8JL3nCTjjzhpdysRO0bPoCo4pBhMkZXJHHKU9BMfN0IUwcYa7ac Js2kOpqY4vDJSB1sso6tQ/Skl3LGJDnETckjEuuleTUgIpfhIF6ytiCEi/DiaYyivSZx 55bxfLddOXGmC/76sAQT6ONhcqtZY/Nr+ZuYx76BsvG6p9f9O5U1ZHuy/iOnqjH74btI fRFu4ZxGm/nvUutVVSK8CgOjJnD+lRCzNhVYCltHpAAWT6cPpMeOlGuQiGWZVyHNwigg MwSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GlueREa58b7R7VgL4TssSAMNWNyU4cNA/gxFnLfVl+c=; b=nRXiOzkt9PwQIEd/pOqKOPoW4vDacg2wPJD8rw9Ob4onyFMpKI3YkEJCuADJr+YohN 1o9asr53WICAjAmfqawIKVXOcxLC8H2jRQ69N6yN/VRGO3ZyEfszf7rHEnNCAYE/laPK H9wm1ZPFYs4u6fpYz+Ap3jGFbed++2fGoE4iYhEGHwHSrzTR2tTD+1ab4JdzfZ+HmXKn WDEJRx7YMeP/h3DEkwy55na6cxxC7oMWEG7gF6azV5d3Nr2qzditW0EhLALHpIiFJJmT L/x7XRmBeSmqqbCgH0/xIv7cJ854LgzZyUXi7+5ZCuVIFWeCqB/W0VLAkLttwUU5nu7g U/iw== X-Gm-Message-State: AOAM532XXNcKPpQzOI5CwbHeCp7uU6uIo38uEL8LwBwp3TV1K8fNhDck HU6jRjTr4bEElTNz/+ndrTY1UqyIIFLE2GaqhES37JDD X-Received: by 2002:a4a:b284:: with SMTP id k4mr22935561ooo.49.1594412836576; Fri, 10 Jul 2020 13:27:16 -0700 (PDT) MIME-Version: 1.0 References: <3f9aeb5d7aa896770946a8c04bd8483e9d7ba4f3.camel@hadess.net> In-Reply-To: <3f9aeb5d7aa896770946a8c04bd8483e9d7ba4f3.camel@hadess.net> From: Luiz Augusto von Dentz Date: Fri, 10 Jul 2020 13:27:05 -0700 Message-ID: Subject: Re: Temporary device removal during discovery To: Bastien Nocera Cc: Andrey Batyiev , linux-bluetooth Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Bastien, On Fri, Jul 10, 2020 at 12:00 PM Bastien Nocera wrote: > > 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. > Right, we still need to clean up the temporary devices though, but perhaps adding a LastSeen property is not a bad idea after all so applications can do this sort of filtering themselves. -- Luiz Augusto von Dentz