[
https://issues.apache.org/jira/browse/HDFS-14088?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16693769#comment-16693769
]
Íñigo Goiri commented on HDFS-14088:
------------------------------------
Thanks [~John Smith] for the patch.
There are a lot of changes but in reality is just adding the synchronized chunk.
We are pretty much doing everything within a synchronized block except for the
exception report and the null check.
Not sure if there's a point on that and not making the whole thing synchronized.
Then regarding currentUsedHandler and currentUsedProxy, it might be better to
just leave the variables as they were and have a lock variable.
For the unit test, should we check some metric in particular?
> RequestHedgingProxyProvider can throw NullPointerException when failover due
> to no lock on currentUsedProxy
> -----------------------------------------------------------------------------------------------------------
>
> Key: HDFS-14088
> URL: https://issues.apache.org/jira/browse/HDFS-14088
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: hdfs-client
> Reporter: Yuxuan Wang
> Assignee: Yuxuan Wang
> Priority: Major
> Attachments: HDFS-14088.001.patch
>
>
> {code:java}
> if (currentUsedProxy != null) {
> try {
> Object retVal = method.invoke(currentUsedProxy.proxy, args);
> LOG.debug("Invocation successful on [{}]",
> currentUsedProxy.proxyInfo);
> {code}
> If a thread run try block and then other thread trigger a fail over calling
> method
> {code:java}
> @Override
> public synchronized void performFailover(T currentProxy) {
> toIgnore = this.currentUsedProxy.proxyInfo;
> this.currentUsedProxy = null;
> }
> {code}
> It will set currentUsedProxy to null, and the first thread can throw a
> NullPointerException.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]