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

Fixing issue #2755: updating config storage inside HTTPServer #2882

Merged
merged 3 commits into from Sep 14, 2022

Conversation

rkreutz
Copy link
Contributor

@rkreutz rkreutz commented Sep 5, 2022

We can update application.storage from within HTTPServer, this way we can keep any changes that happen to the configuration internally up-to-date with the application storage.

This possibly has the least changes and less surface of potential flaws, since we are only adding an extra param and working on top of it. However, now we are setting the application storage from within HTTPServer, there is no issue with that, is just that now we have 2 places changing the storage for the config.

Resolves #2755

We can update application.storage from within HTTPServer, this way we can keep any changes that happen to the configuration internally up-to-date with the application storage
@rkreutz
Copy link
Contributor Author

rkreutz commented Sep 5, 2022

this is an alternative to #2881

@0xTim
Copy link
Member

0xTim commented Sep 6, 2022

This should have been solved in #2764 - does that match with what you were seeing?

@rkreutz
Copy link
Contributor Author

rkreutz commented Sep 6, 2022

In that PR you have reflected changes in configuration back to HTTPServer, which is just part of the fix, we also need to update application.storage[Application.HTTP.Server.ConfigKey] with the new configuration otherwise accessing application.http.server.configuration will be outdated

@0xTim
Copy link
Member

0xTim commented Sep 6, 2022

@rkreutz ah I see - do you want to update the PR so the test reflects the missing config? Thanks!

@rkreutz
Copy link
Contributor Author

rkreutz commented Sep 6, 2022

Should we go with this approach then rather than #2881 ?

@0xTim
Copy link
Member

0xTim commented Sep 6, 2022

Yeah this feels like a better change, keeping it as a struct if possible is desirable as we adopt Sendable throughout the codebase

@rkreutz
Copy link
Contributor Author

rkreutz commented Sep 6, 2022

@0xTim added the unit tests there d0c6778, I've reverted the changes and ran the tests and confirmed they were failing, and after reapplying the change the tests pass

@rkreutz
Copy link
Contributor Author

rkreutz commented Sep 11, 2022

Hey @0xTim anything else here you'd like to have added?

@0xTim 0xTim added the semver-patch Internal changes only label Sep 14, 2022
Copy link
Member

@0xTim 0xTim left a comment

Choose a reason for hiding this comment

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

Apologies, got lost in the queue! This is good to go when CI passes

@gwynne gwynne merged commit dda0de5 into vapor:main Sep 14, 2022
@VaporBot
Copy link
Contributor

These changes are now available in 4.65.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch Internal changes only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http server configuration has wrong hostname and port if they are set through cli ( -H hostname -p port )
4 participants