Wireless Daemon for Linux
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: iwd@lists.01.org
Subject: Re: [PATCH v2 1/2] scan: refactor start_next_scan_request to not send duplicate requests
Date: Tue, 09 Jun 2020 15:10:50 -0500	[thread overview]
Message-ID: <45a9172a-3bcf-eee5-dcfd-a53bd4bd2e7e@gmail.com> (raw)
In-Reply-To: <c5c3d21d-8145-9ddd-afc6-701aa5fa7634@bang-olufsen.dk>

[-- Attachment #1: Type: text/plain, Size: 1997 bytes --]

Hi Alvin,

> I traced the following events leading to a duplicate scan request being sent. 
> The scenario assumes that the scan request queue is empty in the beginning.
> 
> 
> station_enter_state: disconnected -> autoconnect_quick
>    -> station_quick_scan_trigger
>      -> station_scan_trigger: notify cb = station_quick_scan_results
>        -> scan_passive
>          -> scan_common
>            -> scan_request_send_trigger
>            -> l_queue_push_tail: scan request queue size = 1
> scan_notify: quick scan triggered
> network_connect: requested over dbus
>    -> network_connect_psk
>      -> station_connect_network
>        -> station_enter_state: autoconnect_quick -> connecting
>          -> periodic_scan_stop
>            -> scan_periodic_stop
>              -> scan_cancel
> scan_notify: quick scan aborted
>    -> scan_finished
>      -> l_queue_remove: scan request queue size = 0
>      -> station_quick_scan_results: quick scan's notify callback
>      . -> station_enter_state: connecting -> autoconnect_full

Aha, so this is the real culprit.  I fixed this as well in commit 
532f6b154e03b5fa222502098b5688a1784cc4e3.

>      .   -> scan_periodic_start
>      .     -> scan_periodic_queue
>      .       -> scan_{active_full,passive}: idk which; doesn't matter
>      .         -> scan_common
>      .           -> scan_request_send_trigger
>      .           -> l_queue_push_tail: scan request queue size = 1

Okay, so we start a periodic scan and in scan_finished call 
start_next_scan_request again.

>      -> start_next_scan_request: head of queue has already been sent
>        -> scan_request_send_trigger: send it again
> 
> 

And since we don't check that one is already going, we issue the trigger again. 
Makes sense to me now.  Much appreciated.

Regards,
-Denis

      reply	other threads:[~2020-06-09 20:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-01 17:11 [PATCH v2 1/2] scan: refactor start_next_scan_request to not send duplicate requests Alvin =?unknown-8bit?q?=C5=A0ipraga?=
2020-06-01 17:11 ` [PATCH v2 2/2] scan: refactor scan_common to not scan while scanning is suspended Alvin =?unknown-8bit?q?=C5=A0ipraga?=
2020-06-04 18:19   ` Denis Kenzior
2020-06-02  8:45 ` [PATCH v2 1/2] scan: refactor start_next_scan_request to not send duplicate requests Andrew Zaborowski
2020-06-04 18:31 ` Denis Kenzior
2020-06-06 17:33   ` Alvin =?unknown-8bit?q?=C5=A0ipraga?=
2020-06-09 11:49     ` Alvin =?unknown-8bit?q?=C5=A0ipraga?=
2020-06-09 20:10       ` Denis Kenzior [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45a9172a-3bcf-eee5-dcfd-a53bd4bd2e7e@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox