sqm-scripts icon indicating copy to clipboard operation
sqm-scripts copied to clipboard

On OpenWRT, initscript's `reload` is called too frequently/when not necessary

Open brianjmurrell opened this issue 10 months ago • 5 comments

Hi. There's a ticket open in OpenWRT about an observation that sqm-scripts reloads frequently and when it's unnecessary.

I think I've debugged this issue here to the point of understanding that it's happening when my IPv6 WAN connection (which is not even the interface I have SQM configured for!) triggers an ifupdate event. I believe that when this happens https://github.com/tohojo/sqm-scripts/blob/33a89d8e7f6c82acc0adced84cf5cd95447e6bb5/platform/openwrt/sqm-init#L6-L9 causes procd to issue a /etc/init.d/sqm reload.

But clearly this is happening on far too many unrelated events.

Is there any way to do some more checking in /etc/init.d/sqm to limit the reload to only happen when necessary?

brianjmurrell avatar Apr 19 '24 14:04 brianjmurrell

Well, AFAICT from the documentation, that procd_add_reload_trigger thing should only cause a reload if /etc/config/sqm is changed. There's a separate set of commands to add monitoring of interfaces through procd, but we're not using those (we have the hotplug script instead). So I'm not really sure how sqm ends up being reloaded, actually...

tohojo avatar Apr 20 '24 10:04 tohojo

My guess is that the ISP might do something unusual with how IPv6 is supplied here that tickles OpenWrt the wrong way......

On 20. Apr 2024, at 12:43, Toke Høiland-Jørgensen @.***> wrote:

Well, AFAICT from the documentation, that procd_add_reload_trigger thing should only cause a reload if /etc/config/sqm is changed. There's a separate set of commands to add monitoring of interfaces through procd, but we're not using those (we have the hotplug script instead). So I'm not really sure how sqm ends up being reloaded, actually... — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

moeller0 avatar Apr 20 '24 11:04 moeller0

On 20 April 2024 13:44:46 CEST, moeller0 @.***> wrote:

My guess is that the ISP might do something unusual with how IPv6 is supplied here that tickles OpenWrt the wrong way......

Maybe, but that still doesn't explain why the ifupdate event leads to a reload of sqm...

tohojo avatar Apr 20 '24 12:04 tohojo

Well, AFAICT from the documentation, that procd_add_reload_trigger thing should only cause a reload if /etc/config/sqm is changed.

Right!?!?

There's a separate set of commands to add monitoring of interfaces through procd, but we're not using those (we have the hotplug script instead). So I'm not really sure how sqm ends up being reloaded, actually...

Indeed. It is puzzling. Seems like a bug TBH.

Maybe, but that still doesn't explain why the ifupdate event leads to a reload of sqm...

Exactly, which is why it seems like a bug. But what is the OpenWRT component this is a bug with? procd?

brianjmurrell avatar Apr 20 '24 15:04 brianjmurrell

"Brian J. Murrell" @.***> writes:

Maybe, but that still doesn't explain why the ifupdate event leads to a reload of sqm...

Exactly, which is why it seems like a bug. But what is the OpenWRT component this is a bug with? procd?

I think procd is just relaying events; my guess would be that there is some other component triggering this. No idea which :/

tohojo avatar Apr 21 '24 07:04 tohojo