You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sentry.apache.org by Arjun Mishra <am...@cloudera.com> on 2017/07/10 19:57:48 UTC

Review Request 60752: SENTRY-1831 - The MetastorePlugin SyncTask is leaking connection threads when read timed out issues are thrown

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60752/
-----------------------------------------------------------

Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and Na Li.


Repository: sentry


Description
-------

The MetastorePlugin.SyncTask class is a thread running in the background in the HMS side that is used to keep HMS/Sentry in sync with HDFS, or any other words, it pushes a full HMS snapshot to Sentry every time Sentry is out-of-sync. 
However when a timed out exception is thrown when sending the snapshot to Sentry, a retry happens in the next thread run() iteration. 
The problem is that these exceptions do not terminate the Thrift thread sending the data, and a new retry will generate a new Thrift thread be created. We should close those threads by resetting the connection when an error occurs.


Diffs
-----

  sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastorePlugin.java 7a21871b8 


Diff: https://reviews.apache.org/r/60752/diff/1/


Testing
-------


Thanks,

Arjun Mishra


Re: Review Request 60752: SENTRY-1831 - The MetastorePlugin SyncTask is leaking connection threads when read timed out issues are thrown

Posted by Na Li <li...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60752/#review180113
-----------------------------------------------------------


Ship it!




Ship It!

- Na Li


On July 10, 2017, 7:57 p.m., Arjun Mishra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60752/
> -----------------------------------------------------------
> 
> (Updated July 10, 2017, 7:57 p.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and Na Li.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> The MetastorePlugin.SyncTask class is a thread running in the background in the HMS side that is used to keep HMS/Sentry in sync with HDFS, or any other words, it pushes a full HMS snapshot to Sentry every time Sentry is out-of-sync. 
> However when a timed out exception is thrown when sending the snapshot to Sentry, a retry happens in the next thread run() iteration. 
> The problem is that these exceptions do not terminate the Thrift thread sending the data, and a new retry will generate a new Thrift thread be created. We should close those threads by resetting the connection when an error occurs.
> 
> 
> Diffs
> -----
> 
>   sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastorePlugin.java 7a21871b8 
> 
> 
> Diff: https://reviews.apache.org/r/60752/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Arjun Mishra
> 
>


Re: Review Request 60752: SENTRY-1831 - The MetastorePlugin SyncTask is leaking connection threads when read timed out issues are thrown

Posted by Arjun Mishra <am...@cloudera.com>.

> On July 11, 2017, 4:31 p.m., kalyan kumar kalvagadda wrote:
> > sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastorePlugin.java
> > Lines 256 (patched)
> > <https://reviews.apache.org/r/60752/diff/1/?file=1773034#file1773034line256>
> >
> >     Is this cherry-pick?
> >     Can we add test for this scenario?

No it's not cherry-pick. I will work on adding test cases. Thanks


- Arjun


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60752/#review180204
-----------------------------------------------------------


On July 10, 2017, 7:57 p.m., Arjun Mishra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60752/
> -----------------------------------------------------------
> 
> (Updated July 10, 2017, 7:57 p.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and Na Li.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> The MetastorePlugin.SyncTask class is a thread running in the background in the HMS side that is used to keep HMS/Sentry in sync with HDFS, or any other words, it pushes a full HMS snapshot to Sentry every time Sentry is out-of-sync. 
> However when a timed out exception is thrown when sending the snapshot to Sentry, a retry happens in the next thread run() iteration. 
> The problem is that these exceptions do not terminate the Thrift thread sending the data, and a new retry will generate a new Thrift thread be created. We should close those threads by resetting the connection when an error occurs.
> 
> 
> Diffs
> -----
> 
>   sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastorePlugin.java 7a21871b8 
> 
> 
> Diff: https://reviews.apache.org/r/60752/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Arjun Mishra
> 
>


Re: Review Request 60752: SENTRY-1831 - The MetastorePlugin SyncTask is leaking connection threads when read timed out issues are thrown

Posted by kalyan kumar kalvagadda <kk...@cloudera.com>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/60752/#review180204
-----------------------------------------------------------




sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastorePlugin.java
Lines 256 (patched)
<https://reviews.apache.org/r/60752/#comment255252>

    Is this cherry-pick?
    Can we add test for this scenario?


- kalyan kumar kalvagadda


On July 10, 2017, 7:57 p.m., Arjun Mishra wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/60752/
> -----------------------------------------------------------
> 
> (Updated July 10, 2017, 7:57 p.m.)
> 
> 
> Review request for sentry, Alexander Kolbasov, kalyan kumar kalvagadda, and Na Li.
> 
> 
> Repository: sentry
> 
> 
> Description
> -------
> 
> The MetastorePlugin.SyncTask class is a thread running in the background in the HMS side that is used to keep HMS/Sentry in sync with HDFS, or any other words, it pushes a full HMS snapshot to Sentry every time Sentry is out-of-sync. 
> However when a timed out exception is thrown when sending the snapshot to Sentry, a retry happens in the next thread run() iteration. 
> The problem is that these exceptions do not terminate the Thrift thread sending the data, and a new retry will generate a new Thrift thread be created. We should close those threads by resetting the connection when an error occurs.
> 
> 
> Diffs
> -----
> 
>   sentry-hdfs/sentry-hdfs-service/src/main/java/org/apache/sentry/hdfs/MetastorePlugin.java 7a21871b8 
> 
> 
> Diff: https://reviews.apache.org/r/60752/diff/1/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Arjun Mishra
> 
>