Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: EFB Setting to enable MCDU Server connection to avoid too many connection attempts #6947

Merged
merged 12 commits into from
Mar 23, 2022

Conversation

frankkopp
Copy link
Member

@frankkopp frankkopp commented Mar 21, 2022

Summary of Changes

EFB Setting to enable MCDU Server connection to avoid too many connection attempts

It has become apparent that the MSFS internal engine does not close and remove websocket objects correctly when the MCDU server is not reachable (e.g. offline). This has led to memory leaks and stutter issues for many users. This issue has been reported to Asobo 6375.

In the meantime this PR offers a workaround for the issue by introducing an EFB Setting to enable and disable the MCDU Server connection.

The EFB Setting has three options: "Auto On", "Auto Off", "Perm Off".

Auto On: Will try to connect to the MCDU Server with each start of a flight. The number of attempts to connect to a MCDU server is limited to 60 (=5min) after which the EFB setting will be disabled ("Auto Off").
The user can enable the setting immediately again to get another 5min of connection attempts.

Auto Off: After 60 attempts the setting will jump to this setting. If this is the seeting from the last flight it will automatically set to "Auto On" to attempt to connect.

Perm Off: The MCDU will never attempt to connect to the MCDU Server.

Note: Although during the 5min of connection attempts there will be some accumulation of websocket objects this is a good compromise between mitigating the issue and comfort for the user. Especially as users reported issues only after a longer period of flight.

Linked Docs PR: docs update: flybywiresim/docs#499

Screenshots

image

The error messages are expected - although not nice they can't be avoided when trying to make sure all sockets are closed.
image

image

Discord username (if different from GitHub): Cr_Maverick#6475

Testing instructions

  • Check the new EFB Setting "Enable MCDU Server Connection" and enable it ("Auto On") if not already the case.
  • With the MCDU Server OFF wait for 5min and confirm that the new setting will be deactivated ("Auto Off").
    • (you can monitor the progress in the Coherent GT Debugger if you know how to)
  • Try to start the MCDU Server - it should not be able to connect to the aircraft
  • Enable the EFB setting again ("Auto On") - the MCDU Server should no connect to the aircraft
  • Check that the remote Web MCDU Interface works as before
  • Disable the EFB setting - the MCDU Server should loose connection
  • Test "Perm Off" setting - restart the flight (do a new flight to be sure or even restart the sim)
  • Test any other combination you might think of
  • Monitor the FPS counter and general smoothness of the sim is as before

Find the MCDU Server docs here:
https://docs.flybywiresim.com/fbw-a32nx/feature-guides/web-mcdu/

How to download the PR for QA

Every new commit to this PR will cause a new A32NX artifact to be created, built, and uploaded.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, click on the bottom PR tab
  4. Click on the A32NX download link at the bottom of the page

Copy link
Member

@Benjozork Benjozork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to make this applicable to local-api (user-facing name TBD) when that is out too 😉

src/instruments/src/EFB/Settings/Settings.tsx Outdated Show resolved Hide resolved
@frankkopp
Copy link
Member Author

We probably want to make this applicable to local-api (user-facing name TBD) when that is out too 😉

I think this can be transferred 1:1 to the local-api branch. It only touches the MCDU side and doesn't really care about mcdu server or local-api server. I'll do that once merged (might be sufficient to rebase/merge into the local-api branch.)

Alos the EFB 3 branch should get this change then.

@frankkopp frankkopp marked this pull request as ready for review March 21, 2022 12:12
Copy link
Contributor

@Saschl Saschl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See question but otherwise looks good from my perspective!

@Saschl
Copy link
Contributor

Saschl commented Mar 21, 2022

Dev Tester Report

Discord : saschl
Object of testing: #6947
Tier of Testing : 1
Date : 22/03/2022

Testing Process:

  1. Started Cold & Dark, waited for 5 minutes. Checked the debugger. 60 attempts are shown and no leftover sockets are visible, EFB option is set to "AUTO OFF"
    image
  2. Opened EFB, set option to "AUTO ON", check logs. Connection attempts are visible, starting the MCDU connects successfully and the reconnection attempts do stop.
  3. Closing MCDU Server, reconnection attempts become reset and start again. Starting the server again, successful connection.
  4. Set "PERM OFF", restart flight, no connection attempts visible and server will not connect
  5. Set to "AUTO ON" again, wait for "AUTO OFF", restart flight, connection attempts are visible again. EFB setting is "AUTO ON" again.

Note: did not experience stutters :)

Conclusion: LGTM, nice work.

@mico975
Copy link
Contributor

mico975 commented Mar 21, 2022

Quality Assurance Tester Report

Discord : mico#3145
Object of testing: #6947
Tier of Testing : 1
Date : 22/03/2022

Testing Process:
Check the new EFB Setting "Enable MCDU Server Connection" and enable it ("Auto On") if not already the case. - OK
With the MCDU Server OFF wait for 5min and confirm that the new setting will be deactivated ("Auto Off"). - OK
Try to start the MCDU Server - it should not be able to connect to the aircraft - OK
Enable the EFB setting again ("Auto On") - the MCDU Server should now connect to the aircraft - OK
Check that the remote Web MCDU Interface works as before - OK
Disable the EFB setting - the MCDU Server should loose connection - OK
Test "Perm Off" setting - restart the flight - OK
Test any other combination you might think of - All OK
Monitor the FPS counter and general smoothness of the sim is as before - OK

Negatives:
WASM build takes more than 5 minutes for me and it switches to Auto Off before even getting to the aircraft.

Testing Results:
Passed

Conclusions:
LGTM, with a small culprit that could cause higher support loads because of long WASM build times causing Auto Off state for users.

Media:
image

@frankkopp
Copy link
Member Author

Quality Assurance Tester Report

Discord : mico#3145 Object of testing: #6947 Tier of Testing : 1 Date : 22/03/2022

Negatives: WASM build takes more than 5 minutes for me and it switches to Auto Off before even getting to the aircraft.

Conclusions: LGTM, with a small culprit that could cause higher support loads because of long WASM build times causing Auto Off state for users.

I have added a check that it only starts connection attempts after the users clicked "Ready to Fly"

@Saschl Saschl closed this Mar 23, 2022
@Saschl Saschl reopened this Mar 23, 2022
@frankkopp frankkopp merged commit 8527f64 into flybywiresim:master Mar 23, 2022
@frankkopp frankkopp deleted the websocket-connection-setting branch March 23, 2022 17:32
ErickSharp pushed a commit that referenced this pull request Apr 3, 2022
@2hwk 2hwk added this to the v0.8.0 milestone Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EFB Remote MCDU MCDU Server and Web MCDU Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants