-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test extension during JRuby install (#1031)
When installing the extension for JRuby we didn't actually test if the extension was working or not. The `install.report` would report the extension was installed successfully if the artifact archive was downloaded and extracted. We didn't test if the extension functions could be "attached" using FFI. Load the JRuby extension during installation to test if the functions could be attached without issues. When it fails, raise the error rather than logging it, so that the installer can detect and rescue the error to store the installation failure in the `install.report` file.
- Loading branch information
Showing
3 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
bump: "patch" | ||
type: "fix" | ||
--- | ||
|
||
Add more testing to JRuby extension installation to better report the installation result and any possible failures. |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,14 +242,15 @@ def self.lib_extension | |
[:pointer], | ||
:appsignal_string | ||
|
||
Appsignal.extension_loaded = true | ||
Appsignal.extension_loaded = true if Appsignal.respond_to? :extension_loaded= | ||
rescue LoadError => error | ||
error_message = "ERROR: AppSignal failed to load extension. " \ | ||
"Please run `appsignal diagnose` and email us at [email protected]\n" \ | ||
"#{error.class}: #{error.message}" | ||
Appsignal.logger.error(error_message) | ||
Appsignal.logger.error(error_message) if Appsignal.respond_to? :logger | ||
Kernel.warn error_message | ||
Appsignal.extension_loaded = false | ||
Appsignal.extension_loaded = false if Appsignal.respond_to? :extension_loaded= | ||
raise error if ENV["_APPSIGNAL_EXTENSION_INSTALL"] == "true" | ||
end | ||
|
||
def start | ||
|