You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/07/30 17:19:40 UTC
[GitHub] [kafka] highluck opened a new pull request #9105: MINOR: closable object Memory leak prevention
highluck opened a new pull request #9105:
URL: https://github.com/apache/kafka/pull/9105
closable object Memory leak prevention
### Committer Checklist (excluded from commit message)
- [ ] Verify design and implementation
- [ ] Verify test coverage and CI build status
- [ ] Verify documentation (including upgrade notes)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on a change in pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r464215307
##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException {
final FileChannel channel;
- try {
- channel = getOrCreateFileChannel(taskId, lockFile.toPath());
+ try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) {
Review comment:
thanks for review
It works, but it seems strange.
The code was updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on a change in pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r464215307
##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException {
final FileChannel channel;
- try {
- channel = getOrCreateFileChannel(taskId, lockFile.toPath());
+ try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) {
Review comment:
thanks for review
I was mistaken and wrong
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#issuecomment-667844194
@abbccdda
Please review again thank you :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] abbccdda commented on a change in pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
abbccdda commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r463708981
##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException {
final FileChannel channel;
- try {
- channel = getOrCreateFileChannel(taskId, lockFile.toPath());
+ try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) {
Review comment:
It looks weird to use the resource outside of try block, does this really work?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck closed pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck closed pull request #9105:
URL: https://github.com/apache/kafka/pull/9105
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on a change in pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r464215307
##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException {
final FileChannel channel;
- try {
- channel = getOrCreateFileChannel(taskId, lockFile.toPath());
+ try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) {
Review comment:
thanks for review
I was mistaken and wrong
Since it is a reference, it does not seem to need to be closed separately.
The code was updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on a change in pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r464215307
##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException {
final FileChannel channel;
- try {
- channel = getOrCreateFileChannel(taskId, lockFile.toPath());
+ try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) {
Review comment:
thanks for review
I was mistaken and wrong
The code was updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on a change in pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on a change in pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#discussion_r464215307
##########
File path: streams/src/main/java/org/apache/kafka/streams/processor/internals/StateDirectory.java
##########
@@ -197,8 +197,8 @@ synchronized boolean lock(final TaskId taskId) throws IOException {
final FileChannel channel;
- try {
- channel = getOrCreateFileChannel(taskId, lockFile.toPath());
+ try (final FileChannel fileChannel = getOrCreateFileChannel(taskId, lockFile.toPath())) {
Review comment:
thanks for review
I was mistaken and wrong
The code was updated
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck commented on pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck commented on pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#issuecomment-667867206
@abbccdda
thanks for review
I was mistaken and wrong
close issue
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] highluck removed a comment on pull request #9105: MINOR: closable object Memory leak prevention
Posted by GitBox <gi...@apache.org>.
highluck removed a comment on pull request #9105:
URL: https://github.com/apache/kafka/pull/9105#issuecomment-667844194
@abbccdda
Please review again thank you :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org