Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp474011ybt; Wed, 8 Jul 2020 04:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0SpyYfwMRolNxKAh6BzRRIAaUcS5tIllLCkK0Mw2b8kH8FNi2E/5zvdUH7hh5pGf3Ei/u X-Received: by 2002:a05:6402:1c0f:: with SMTP id ck15mr63724311edb.155.1594207960396; Wed, 08 Jul 2020 04:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594207960; cv=none; d=google.com; s=arc-20160816; b=WzWa2qO+DfAf6liYsnSouBR6y4CcgPBYm/5AU5cjeaIkS7K0xiGjs0ipkTj/cn+7Hf i0CdTa0zn0tuZM3jP5aKgfDH/jWKyPwBsEem2Y4UVEttwi9fm0hoFqLxLn5wZRJChvvF +LqArFSv03pONG6YuUMVEEMVvXp6ej7GU7m8jiCisgZluj/daxA3OBTlfI+BFp4bSO6w uZG2kQrP73LbcQt6J2ZmL++fins1Zyu3v3qNK4Ck5fzOwSyaUcM9W+PblpwMyvVVA6mP oi55SnxCz9UFVykMIN1+w1YCDUZw3RcaWRMfJ5W1jjoRYu1oNyWuOa/XBI8RSFlOV1q2 tW5g== 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:to:from:subject:message-id; bh=pePgJlFGg/6GJEPXHMacSxRab5aRBwb62zOgVAznimc=; b=oiiBVyrXFG86J9kDAi680e87PTALMhP+DxWC3odm3QYEj2S/wislB7JY1UapyiPYrd eaLb6eEy91xD5sy71rJG1FSShjnAVcSlnvkFwSfjJ838quznGdakXSBgYaDMYZsawVNS 9BZ2fuwSZGaXOsf5wKyJ4f0HrBxVrklTxmGvt0aSkrijlS3z8y5RnEM+afnZVQPNJ/WR 6a9ZSKVWyRYPSzd3s9AJ7SmFAsvODfKJQuaExGRCpWi8TLcE+oi7apOD7JN/7z0kx4cM 5wAFztgl2gfzCUGI8OQhGgeEqMP4hMBbK1lWVp37HzUGTkhmeO4ONQEYmvPvHqbe2kXF vNZA== 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 qk1si16213198ejb.15.2020.07.08.04.32.01; Wed, 08 Jul 2020 04:32:40 -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 S1728688AbgGHL3c (ORCPT + 99 others); Wed, 8 Jul 2020 07:29:32 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:55527 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728385AbgGHL3c (ORCPT ); Wed, 8 Jul 2020 07:29:32 -0400 Received: from classic (lns-bzn-39-82-255-60-242.adsl.proxad.net [82.255.60.242]) (Authenticated sender: hadess@hadess.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 0657B240011; Wed, 8 Jul 2020 11:29:29 +0000 (UTC) Message-ID: Subject: Re: Temporary device removal during discovery From: Bastien Nocera To: Andrey Batyiev , linux-bluetooth Date: Wed, 08 Jul 2020 13:29:29 +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 Hey Andrey, On Wed, 2020-07-08 at 13:24 +0300, Andrey Batyiev wrote: > Hello everyone, > > I've found the following issue: > 1. in bluetoothctl run "power on", "scan on" > 2. discovery is now permanent > 3. make one device discoverable for a moment (e.g. turn bluetooth on > on your phone) > 4. bluez would detect new device > 5. turn bluetooth off on your phone > 6. now wait > > Expected result: > 7. your phone should disappear from discovered set after some time > > Actual result: > 7. phone would stay there until discovery is off (i.e. "scan off" in > bluetoothctl) > > > It seems like there is a code in src/adapter.c responsible for purge > stale entries > (remove_temp_devices), however it only triggers when discovery is off > (and after 3 mins). > > > My use case is to continuously monitor the bluetooth environment. Is > it bluez responsibility to > remove stale entries during discovery or should my own app repeatedly > stop discovery? It's been a problem for a while. I sent one of those mails as well: https://www.spinics.net/lists/linux-bluetooth/msg75947.html https://www.spinics.net/lists/linux-bluetooth/msg74397.html Can you please file a bug at https://github.com/bluez/bluez/issues ? I'll CC: myself on it too. Cheers