Wait for device activation after connection switch - #176
sergey-arkhipov wants to merge 3 commits into
Conversation
|
I don't understand exactly what problem this PR is trying to solve? Can you It also fails to run with these errors and you left debug code in the PR. ✦ ❯ ./networkmanager_dmenu Please provide a clear description and fix the errors or I will close. |
b13b1f6 to
22c3225
Compare
|
You're right, sorry — leftover debug Re: the actual issue — reliably reproducible:
This patch fixes it by blocking until the device reaches ACTIVATED |
|
Can you post (redacted) output of I don't easily have the ability to create secondary connections, so trying to make sure your config matches what I'd expect. Thanks |
Ensures NetworkManager has time to tear down secondary connections (VPN, etc.) before the script exits.
22c3225 to
40d5cb0
Compare
|
Sorry, it was not as hard as I thought to test with a secondary connection. I was getting a crash message I tested with openvpn secondaries attached to two different wifi networks and switched back and forth between the two. Seems to work now. I did see the issue you were describing without the fix. Thanks for reporting! Please test the revised PR. |
|
Hi firecat53, Tested your revised PR — the AP-switch case works now. However, I'm seeing the same issue when switching via a saved Looks like the same root cause in a different path: saved |
|
Ok, another fix pushed. Let me know if it works for you. Thanks! |
|
Thanks, firecat53! Tested both the AP-switch and saved-connection |
Problem:
When switching to a new Wi-Fi connection that has secondary connections
(VPN, WireGuard, etc.) configured,
networkmanager_dmenuexits as soonas
activate_connection_asyncfinishes. NetworkManager then does nothave enough time to properly tear down the previous secondary
connections, leaving them in an inconsistent state.
Solution:
After
activate_connection_asynccompletes andLOOP.run()returns,block until the device actually reaches
ACTIVATEDstate. This matchesthe behavior of
nmcli connection up. A 30-second safety timeoutprevents the script from hanging.
Changes:
process_ap(): callwait_for_device_activated(adapter)afterLOOP.run()when activating a known connection.wait_for_device_activated(): connects to the device'sstate-changedsignal and blocks on the main loop untilNM.DeviceState.ACTIVATEDis reached.Testing:
correctly triggers teardown and re-establishment of the VPN tunnel.