[
https://issues.apache.org/jira/browse/HADOOP-18781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17742005#comment-17742005
]
ASF GitHub Bot commented on HADOOP-18781:
-----------------------------------------
mehakmeet opened a new pull request, #5830:
URL: https://github.com/apache/hadoop/pull/5830
<!--
Thanks for sending a pull request!
1. If this is your first time, please read our contributor guidelines:
https://cwiki.apache.org/confluence/display/HADOOP/How+To+Contribute
2. Make sure your PR title starts with JIRA issue id, e.g.,
'HADOOP-17799. Your PR title ...'.
-->
### Description of PR
To avoid the ABFS instance getting closed due to GC while the streams are
working, attach the ABFS instance to a backReference opaque object and passing
down to the streams so that we have a hard reference while the streams are
working.
### How was this patch tested?
`mvn -Dparallel-tests=abfs -DtestsThreadCount=8 -Dscale clean verify`
```
[INFO] Results:
[INFO]
[WARNING] Tests run: 141, Failures: 0, Errors: 0, Skipped: 5
```
```
[INFO] Results:
[INFO]
[WARNING] Tests run: 586, Failures: 0, Errors: 0, Skipped: 76
```
```
[INFO] Results:
[INFO]
[WARNING] Tests run: 339, Failures: 0, Errors: 0, Skipped: 41
```
### For code changes:
- [ ] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
> ABFS backReference passed down to streams to avoid GC closing the FS.
> ---------------------------------------------------------------------
>
> Key: HADOOP-18781
> URL: https://issues.apache.org/jira/browse/HADOOP-18781
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs/azure
> Reporter: Mehakmeet Singh
> Assignee: Mehakmeet Singh
> Priority: Major
> Labels: pull-request-available
>
> Applications using AzureBlobFileSystem to create the AbfsOutputStream can use
> the AbfsOutputStream for the purpose of writing, however, the OutputStream
> doesn't hold any reference to the fs instance that created it, which can make
> the FS instance eligible for GC, when this occurs, AzureblobFileSystem's
> `finalize()` method gets called which in turn closes the FS, and in turn call
> the close for AzureBlobFileSystemStore, which uses the same Threadpool that
> is used by the AbfsOutputStream. This leads to the closing of the thread pool
> while the writing is happening in the background and leads to hanging while
> writing.
>
> *Solution:*
> Pass a backreference of AzureBlobFileSystem into AzureBlobFileSystemStore and
> AbfsOutputStream as well.
>
> Same should be done for AbfsInputStream as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]