Fix: Incorrect radius error & retry handling #3490
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Fixes #3486
While fixing this bug, I found 2 annoying issues with the
node-radius-client
library:The library has a built-in retry mechanism, and defaults to 3 retries. A bug in the library also prevents me from disabling this retry mechanism. This would interfere with our own retries and timings. For example, if you set our beat interval to 20 seconds with no retries, the library would retry on its own 3 times, which would lead to a real interval of ~60 seconds. To mitigate this, I have set the library's retry to the minimum of 1, and halved the connection timeout. This still takes much longer than 20 seconds for some reason, but it's the best I can do.
The library uses
Math.random
to generate a random port for connection instead of getting an available port😅. This leads to randomBIND EACCES
errors if the port is occupied.As discovered before, the repository for node-radius-client was deleted or set to private, so there is no place to report these issues. We need to think about forking the library or finding a more reasonable alternative.
Type of change
Checklist
(including JSDoc for methods)
Screenshots (if any)