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

Delay in Instance Status Updates at Driver-Level #1949

Open
joepavitt opened this issue Apr 11, 2023 · 9 comments
Open

Delay in Instance Status Updates at Driver-Level #1949

joepavitt opened this issue Apr 11, 2023 · 9 comments
Labels
bug Something isn't working priority:low Low Priority

Comments

@joepavitt
Copy link
Contributor

Current Behavior

In reviewing #1926 I have significant delays (> 5 minutes) of retrieving status updates. This seems to be happening at the localfs driver level, rather than linked to polling - @Pezmc and I were logging inside the liveState() function found in /forge/db/models/Project.js and this will[ regualrly reporting "starting" as the status, despite the Node-RED logs reporting "started flows" around 5 minutes ago.

Expected Behavior

The status should be reflected to it's Live condition.

Steps To Reproduce

Restart an instance of Node-RED within FlowForge, when running the localfs driver

Environment

@joepavitt joepavitt added needs-triage Needs looking at to decide what to do bug Something isn't working labels Apr 11, 2023
@joepavitt
Copy link
Contributor Author

Need to check if in staging when we deploy

@joepavitt joepavitt added the priority:medium Medium Priority label Apr 11, 2023
@joepavitt joepavitt added this to the 1.6 milestone Apr 11, 2023
@joepavitt
Copy link
Contributor Author

verified this isn't an issue on Staging, but is still a problem locally. Downgrading the priority label

@joepavitt joepavitt added priority:low Low Priority and removed needs-triage Needs looking at to decide what to do priority:medium Medium Priority labels Apr 12, 2023
@joepavitt joepavitt removed this from the 1.6 milestone Apr 12, 2023
@joepavitt
Copy link
Contributor Author

joepavitt commented May 5, 2023

Debugging with Nick, tracked down to statusPoll inside nr-launcher/llib/launcher.js - imminent changes due with an open PR, want to wait for those changes to merge, before investigating further, as we are at the point of debugging out-dated code.

@joepavitt
Copy link
Contributor Author

Tracked to status polling trying to reach an ipv6 address, rather than localhost:

RequestError: connect ECONNREFUSED ::1:12080

this.settings.baseURL is set correctly (http://localhost;12080), Nick isn't sure what's going on.

@hardillb
Copy link
Contributor

hardillb commented May 5, 2023

We need to check settings.js to see what it's binding to. We've run into this on normal Node-RED recently (I'll try and find the issue I discussed it with DCJ in )

@hardillb
Copy link
Contributor

hardillb commented May 5, 2023

This was a WebSockets issue, but it feels the same:

node-red/node-red#4010

It's down to how newer versions of NodeJS order DNS results and I think NR defaults to binding to 0.0.0.0 which is IPv4 only where as binding to :: would bind to both if available.

And the OS returns both ::1 and 127.0.0.1 for localhost these days.

@joepavitt
Copy link
Contributor Author

Forgot to mention I'm running node v18, Nick was on an older version, and also concluded this was a Node version issue.

@hardillb
Copy link
Contributor

hardillb commented May 5, 2023

I can think of 2 fixes for this

  1. We change the flowforge-nr-launcher to set uiHost to :: to override the default of 0.0.0.0 which will get Node-RED to bind to both IPv4 and IPv6. I'm not 100% sure what happens on a machine with no IPv6 at all in this case. (Pretty much all OS these days enable IPv6 by default, even if there is no address setup loopback will still get assigned ::1)
  2. We change the flowforge-driver-localfs to use 127.0.0.1 rather than localhost as the hostname for all it's interaction with Node-RED, this would work round the change in order that IP name mappings are returned by the newer versions of NodeJS

@joepavitt
Copy link
Contributor Author

I have verified (with Ben) that 1. does fix the issue for me locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:low Low Priority
Projects
Status: Review
Development

No branches or pull requests

2 participants