Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
3201d22c
Commit
3201d22c
authored
7 years ago
by
Ryan Senior
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #5471 from metabase/aot-get-stack-trace-bug
Workaround for AOT protocol bug with getStackTrace
parents
b7c6965e
090cc7b1
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/util.clj
+14
-4
14 additions, 4 deletions
src/metabase/util.clj
with
14 additions
and
4 deletions
src/metabase/util.clj
+
14
−
4
View file @
3201d22c
...
...
@@ -575,16 +575,26 @@
(
filtered-stacktrace
[
this
]
"Get the stack trace associated with E and return it as a vector with non-metabase frames filtered out."
))
;; These next two functions are a workaround for this bug https://dev.clojure.org/jira/browse/CLJ-1790
;; When Throwable/Thread are type-hinted, they return an array of type StackTraceElement, this causes
;; a VerifyError. Adding a layer of indirection here avoids the problem. Once we upgrade to Clojure 1.9
;; we should be able to remove this code.
(
defn-
throwable-get-stack-trace
[
^
Throwable
t
]
(
.getStackTrace
t
))
(
defn-
thread-get-stack-trace
[
^
Thread
t
]
(
.getStackTrace
t
))
(
extend
nil
IFilteredStacktrace
{
:filtered-stacktrace
(
constantly
nil
)})
(
extend
Throwable
IFilteredStacktrace
{
:filtered-stacktrace
(
fn
[
^
Throwable
this
]
(
filtered-stacktrace
(
.
get
S
tack
T
race
this
)))})
IFilteredStacktrace
{
:filtered-stacktrace
(
fn
[
this
]
(
filtered-stacktrace
(
throwable-
get
-s
tack
-t
race
this
)))})
(
extend
Thread
IFilteredStacktrace
{
:filtered-stacktrace
(
fn
[
^
Thread
this
]
(
filtered-stacktrace
(
.
get
S
tack
T
race
this
)))})
IFilteredStacktrace
{
:filtered-stacktrace
(
fn
[
this
]
(
filtered-stacktrace
(
thread-
get
-s
tack
-t
race
this
)))})
;; StackTraceElement[] is what the `.getStackTrace` method for Thread and Throwable returns
(
extend
(
Class/forName
"[Ljava.lang.StackTraceElement;"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment