Disconnect SPI at end of Function_create - #549
Merged
Merged
Conversation
Issue #544 presented a mystery where the regression test for trigger transition tables would succeed with check_function_bodies on, but fail with check_function_bodies off. In the 'on' case, the function would be ready to use ahead of its first invocation (the validator having done all the necessary work). The first invocation would find the function cached and invoke it, with SPI not yet connected. On the function's first use of SPI, Invocation_assertConnect sees there is a TriggerData associated with the invocation, and registers the transition tables to make them visible by the expected names. In the 'off' case, the function's first invocation requires Function_create to do its work, which may involve an SPI connection from PL/Java's class loader. Taking place before the invocation has been recognized as handling a trigger, this connection is made without registering the transition tables. By the time the function itself first uses SPI, the TriggerData has been associated with the invocation, but no registration occurs because SPI is already connected. Ending any SPI connection that Function_create may have made ensures that the first use of SPI by the function itself makes a new SPI connection that is appropriately set up. It is a bug for check_function_bodies to have an effect on a function's runtime behavior and not just on its validation. To catch such behavior in the future, the regression test script now repeats the example jar installation and test execution with check_function_bodies set to off.
The failing run on initial creation of this PR was from a CI system that should not even have been activated for this PR.
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.
The bug in issue #544 was exposed by the
check_function_bodiessetting having an effect on actual runtime behavior, not just on validation. This PR fixes that bug and also adds testing withcheck_function_bodies = offto the CI script.Addresses #544.