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

Add ability to specify timeout and retries per relay #239

Merged
merged 1 commit into from
Feb 15, 2024

Conversation

0xAX
Copy link
Member

@0xAX 0xAX commented Feb 15, 2024

In this commit we add ability to specify 'timeout' and 'retries' configuration options per proxy relay.

For example:

{default_route, {{127, 0, 0, 1}, 1813, <<"secret">>},
  [{pool, pool_name}, {retries, 5}, {timeout, 5000}]

or

{routes, [{"^test-[0-9].", {{127, 0, 0, 1}, 1815, <<"secret1">>},
         [{pool, pool_name}, {retries, 5}, {timeout, 5000}]}]}]

If 'retries' and 'timeout' are not specified default values from options option will be used as before.

Backward compatibility is preserved. So, old configuration:

{default_route, {{127, 0, 0, 1}, 1813, <<"secret">>}, pool_name}

also will work.

@0xAX 0xAX requested a review from a team as a code owner February 15, 2024 09:26
@javiermtorres
Copy link

Is this change backwards compatible in configuration? Will an old configuration still work (possibly with some defaults)?

_ -> {R, Relay, Pool}
case validate_route({Relay, RouteOptions}) of
false ->
false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Here mixed tabs with spaces

ebengt
ebengt previously approved these changes Feb 15, 2024
Copy link

@ebengt ebengt left a comment

Choose a reason for hiding this comment

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

looks good

@javiermtorres
Copy link

Is this change backwards compatible in configuration? Will an old configuration still work (possibly with some defaults)?

Sorry for not reading the comments. Partially answered, but will the plain poolname option instead of using [{pool, poolname}] still work?

@0xAX
Copy link
Member Author

0xAX commented Feb 15, 2024

Sorry for not reading the comments. Partially answered, but will the plain poolname option instead of using [{pool, poolname}] still work?

After the latest update it will.

In this commit we add ability to specify 'timeout' and 'retries'
configuration options per proxy relay.

For example:

```
{default_route, {{127, 0, 0, 1}, 1813, <<"secret">>},
  [{pool, pool_name}, {retries, 5}, {timeout, 5000}]
```

or

```
{routes, [{"^test-[0-9].", {{127, 0, 0, 1}, 1815, <<"secret1">>},
         [{pool, pool_name}, {retries, 5}, {timeout, 5000}]}]}]
```

If 'retries' and 'timeout' are not specified default values from
`options` option will be used as before.

Backward compatibility is preserved. So, old configuration:

```
{default_route, {{127, 0, 0, 1}, 1813, <<"secret">>}, pool_name}
```

also will work
@javiermtorres
Copy link

Thanks a lot :)

%% '''
%%
%% Where the pool_name is optional field that contains list of
%% RADIUS servers pool name that will be used for fail-over.
%% Or for backward compatibility:

Choose a reason for hiding this comment

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

👍

Copy link

@javiermtorres javiermtorres left a comment

Choose a reason for hiding this comment

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

LGTM

@0xAX 0xAX merged commit 5fc23c6 into travelping:master Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants