Repository navigation
GH-1574 Fix SupplierExporter and FunctionEndpointInitializer lifecycle edge cases - #1578
Open
seonwooj0810 wants to merge 1 commit into
Open
seonwooj0810 wants to merge 1 commit into
seonwooj0810 wants to merge 1 commit into
Conversation
…zer lifecycle edge cases Mark SupplierExporter as running before subscribing and tolerate a missing subscription in stop(), so a stream that completes while subscribing no longer fails and leaves the exporter marked as running. Do not fail in FunctionEndpointInitializer when there is no WebExceptionHandler or HttpHandler bean. Stop the HTTP server when its application context is closed. The startup thread has to stay non-daemon since it keeps the JVM alive while the server is running, but it now ends together with the context. Resolves spring-cloud#1574 Signed-off-by: seonwoo_jung <79202163+seonwooj0810@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1574
SupplierExporter: when the stream completed while subscribing,stop()ran beforesubscriptionwas assigned, threw aNullPointerException, andrunningwas then set totrue. The exporter is now marked as running before it subscribes, andstop()tolerates a missing subscription.FunctionEndpointInitializer, missing beans: without aWebExceptionHandlerit falls back toWebFluxResponseStatusExceptionHandler(the WebFlux default). Without anHttpHandlerno server is started.FunctionEndpointInitializer, non-daemon thread: I kept the thread non-daemon and stop the server when its context is closed instead. That thread is what keeps the JVM alive. Running a smallFunctionalSpringApplicationstandalone:context.close()setDaemon(true)mainreturnsFive regression tests added; all of them fail without the change.
Verification done:
./mvnw -pl spring-cloud-function-web clean installpasses (256 tests, 0 failures, 25 skipped, checkstyle included). No other open PR or commit onmaincovers this issue.