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
LTS v21.12 Deprecations #2306
LTS v21.12 Deprecations #2306
Conversation
I am happy to see old streaming removed in all forms, even if it takes some time. The Also, there actually might not be much use for supporting |
@Tronic another point worth mentioning is the discussion that started in Discord re: sync v async file reads. While |
Strictly all blocking disk I/O is best avoided when the server is running. Unfortunately even the simplest disk access can take 10+ seconds when SSDs are doing their reorganization, when btrfs is doing its, or when mechanical drives are spinning up. Throughput needs to be optimized elsewhere, e.g. reading all small static files (if known not to change on disk, or if there is a background thread that monitors for changes) to RAM and serving from there (probably needs to be done by the application or at the very least an extension, as it is hard to see how Sanic core could offer that). |
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
This is actually going to become *VERY* important if we change the multiprocessing from `fork` to `spawn` in next version. Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
This is for compatibility with newly-released Sanic 21.12 which removed the deprecated `abort()` in sanic-org/sanic#2306. Before that, it was a simple wrapper around `raise SanicException` (https://github.com/sanic-org/sanic/blob/523db190a732177eda5a641768667173ba2e2452/sanic/exceptions.py#L262-L265), so this change makes it explicit and removes the dependency on `abort()`.
This is for compatibility with newly-released Sanic 21.12 which removed the deprecated `abort()` in sanic-org/sanic#2306. Before that, it was a simple wrapper around `raise SanicException` (https://github.com/sanic-org/sanic/blob/523db190a732177eda5a641768667173ba2e2452/sanic/exceptions.py#L262-L265), so this change makes it explicit and removes the dependency on `abort()`.
* Replace `abort()` with `raise SanicException` This is for compatibility with newly-released Sanic 21.12 which removed the deprecated `abort()` in sanic-org/sanic#2306. Before that, it was a simple wrapper around `raise SanicException` (https://github.com/sanic-org/sanic/blob/523db190a732177eda5a641768667173ba2e2452/sanic/exceptions.py#L262-L265), so this change makes it explicit and removes the dependency on `abort()`. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Add RELEASE.md * Bump sanic from 21.9.3 to 21.12.0 Bumps [sanic](https://github.com/sanic-org/sanic) from 21.9.3 to 21.12.0. - [Release notes](https://github.com/sanic-org/sanic/releases) - [Changelog](https://github.com/sanic-org/sanic/blob/main/CHANGELOG.rst) - [Commits](sanic-org/sanic@v21.9.3...v21.12.0) --- updated-dependencies: - dependency-name: sanic dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update sanic-testing to 0.8.2 (0.7.0 uses the old `app.test_client` attribute which has been deprecated in Sanic 21.12). * Update tests * Skip sanic tests on windows Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Patrick Arminio <patrick.arminio@gmail.com>
Co-authored-by: Néstor Pérez <25409753+prryplatypus@users.noreply.github.com>
This pull request has been mentioned on Sanic Community Discussion. There might be relevant details there: https://community.sanicframework.org/t/v22-6-cant-not-use-sanic-auto-register-true/1035/2 |
There are a number of things we need to remove in the next release:
abort
CompositionView
StreamingHTTPResponse
Sanic
andBlueprint
to use__slots__
Config.load_env
Most of these are straightforward. The open question is re:
StreamingHTTPResponse
. More particularly, the two convenience methods we had for instantiating it:response.stream
andresponse.file_stream
.While the release notes and warning have made it clear that
StreamingHTTPResponse
would be removed, we also said that the convenience methods would stick around for some time. Therefore: we must provide backwards compat in v21.12.I have accomplished this with a new
ResponseStream
object which is a fairly lightweight and is meant to be a compat layer. What we really need to do is to decide the fate ofstream
andfile_stream
.I propose the following:
stream
and mark it for removal in v22.6.file_stream
in the form proposed in this PR.There really is no longer a utility in
stream
. Even if we do not mark it for removal, I would advocate for removing it from the docs and leaving it as undocumented in the User Guide since it is no longer the preferred method for handling these. On the other hand,file_stream
does have utility separate fromStreamingHTTPResonse
, so I think we should carry that one forward.Other thoughts? Opinions?