-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-22870 reflection fails to access a private nested class #503
Conversation
Did you raise a related JIRA ticket? If not, please raise one first, it is easy for history tracking. |
hbase-2.1.5 will be deployed in our product environment, now, interface compablity, integration test and fault exercises are being performed, so more and more bugs will be exposed. I want to contribute bugfix, how can I do? It there a guide doc for new comer? |
HBASE-22870, is it yours? Please update the description in JIRA too. |
@Reidddddd |
@@ -3906,7 +3906,7 @@ public boolean isShutDown() { | |||
/** | |||
* Force to terminate region server when abort timeout. | |||
*/ | |||
private static class SystemExitWhenAbortTimeout extends TimerTask { | |||
public static class SystemExitWhenAbortTimeout extends TimerTask { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is reasonable to keep it private since it is an inner task which should not be seen outside service.
I suggest using
getDeclaredConstructor().setAccessible(true).newInstance()
to bypass it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, good suggest, setAccessible return void, so should write like this
Constructor<? extends TimerTask> timerTaskCtor =
Class.forName(conf.get(ABORT_TIMEOUT_TASK, SystemExitWhenAbortTimeout.class.getName()))
.asSubclass(TimerTask.class).getDeclaredConstructor();
timerTaskCtor.setAccessible(true);
abortTimeoutTask = timerTaskCtor.newInstance();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Reidddddd
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Let's wait some time to see if any other comment. I'll will commit it tomorrow if no further comment. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
commit |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
HMaster crashes at org/apache/hadoop/hbase/regionserver/HRegionServer.java:1044
A private static nested class can not be instantiated via reflection.
code snippet
log in product environtment