connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: "VAUTRIN Emmanuel (Canal Plus Prestataire)"
	<Emmanuel.VAUTRIN@cpexterne.org>
Cc: Jussi Laakkonen <jussi.laakkonen@jolla.com>,
	"connman@lists.linux.dev" <connman@lists.linux.dev>
Subject: Re: [PATCH] service: Fix preferred service reordering on ready state
Date: Mon, 21 Jun 2021 09:30:00 +0200	[thread overview]
Message-ID: <20210621073000.uz23zb7bv2qmchrh@beryllium.lan> (raw)
In-Reply-To: <PR1PR02MB47943483C93F21149F412B96930E9@PR1PR02MB4794.eurprd02.prod.outlook.com>

Hi,

On Thu, Jun 17, 2021 at 10:22:18AM +0000, VAUTRIN Emmanuel (Canal Plus Prestataire) wrote:
> > The thing is that I've been doing similar work on our fork and the end 
> > result turned out to be fixing the sorting of the services.
> Great.
> 
> > It does not anyways seem to be quite feasible to first let the sorting re-arrange 
> > services, then with these changes make exceptions based on a specific 
> > state, which then will change after the services are again sorted?
> > I haven't submitted our changes to upstream just mainly because of 
> > historic reasons there is a bit of a different approach in use with 
> > service.c. This hopefully changes when there is time to check all things 
> > and get the fork closer to upstream. Our for does involve a slightly 
> > stricter approach [...]
> > and the unit tests (that are not yet 100% complete) [...]
> I have no opinion about that, my knowledge of this part is to light,
> and I have just a limited time to spend on it. I let Daniel check this
> part.

The whole sorting logic is a overloaded with corner cases. So I am very
careful with any change in this area.

> > But since this is about allowing to follow the preferred technologies 
> > list that is being set why not do it in the place where the list is 
> > already utilized for sorting? I mean that as there is a clear reference 
> > to prefer online over ready state so the preferred technologies list 
> > should be as an exception in this regard.
> > Your approach works but I'm not sure if there are some corner cases 
> > induced by this approach. These are my notes on this matter, I hope you 
> > consider this proposition.
> As first step, I have just proposed a direct fix based on current implementation
> (also fixing the service state update notification), in order to limit
> regressions and quickly be integrated.
> In my opinion, the second step will consist in a more consequent work,
> based directly on the sorting itself, what Daniel has probably also started
> by his side, but of course, I let him decide the best way to follow. If required,
> I can try spending some time to test the final solution based on your both works.

There were already not trivial fixes for this section of the code
[1]. It clearly shows that there a lot of corner cases to be
considered. While Emmanuel's change looks innocent, I can't really say
it doesn't have any unwanted side effects. As Jussi points out, the
initial problem is clearly in service_compare() not utilizing the
PreferredTechnologies setting. My suggestion is to use fix first the
sorting as this seems to be something we can agree on it.

Can we agree on this one:

   https://lore.kernel.org/connman/20210621072036.302-1-wagi@monom.org/

? And fix the remaining problems in tiny steps?

Thanks,
Daniel

[1]
5bd396590fdf ("service: Send state changed signal after downgrading state")
82c0faebfe4d ("service: Notify leaving online state when downgrading it to ready")

  reply	other threads:[~2021-06-21  7:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-14  9:41 [PATCH] service: Fix preferred service reordering on ready state VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-06-14 10:29 ` Jussi Laakkonen
2021-06-15 12:35   ` VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-06-17  9:07     ` Jussi Laakkonen
2021-06-17 10:22       ` VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-06-21  7:30         ` Daniel Wagner [this message]
2021-06-21  8:35           ` VAUTRIN Emmanuel (Canal Plus Prestataire)
2021-06-22 15:38             ` VAUTRIN Emmanuel (Canal Plus Prestataire)

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=20210621073000.uz23zb7bv2qmchrh@beryllium.lan \
    --to=wagi@monom.org \
    --cc=Emmanuel.VAUTRIN@cpexterne.org \
    --cc=connman@lists.linux.dev \
    --cc=jussi.laakkonen@jolla.com \
    /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;
as well as URLs for NNTP newsgroup(s).