flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sihua Zhou (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-9735) Potential resource leak in RocksDBStateBackend#getDbOptions
Date Wed, 04 Jul 2018 13:12:00 GMT

    [ https://issues.apache.org/jira/browse/FLINK-9735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16532728#comment-16532728
] 

Sihua Zhou commented on FLINK-9735:
-----------------------------------

Hi [~yuzhihong@gmail.com], I think this is a non issue, because the opt will be reused. If
we have a look at the java doc of the {{OptionsFactory#createDBOptions()}} we can find that
this is intended.

{code:java}
public interface OptionsFactory extends java.io.Serializable {

	/**
	 * This method should set the additional options on top of the current options object.
	 * The current options object may contain pre-defined options based on flags that have
	 * been configured on the state backend.
	 *
	 * <p>It is important to set the options on the current object and return the result
from
	 * the setter methods, otherwise the pre-defined options may get lost.
	 *
	 * @param currentOptions The options object with the pre-defined options.
	 * @return The options object on which the additional options are set.
	 */
	DBOptions createDBOptions(DBOptions currentOptions);

	/**
	 * This method should set the additional options on top of the current options object.
	 * The current options object may contain pre-defined options based on flags that have
	 * been configured on the state backend.
	 *
	 * <p>It is important to set the options on the current object and return the result
from
	 * the setter methods, otherwise the pre-defined options may get lost.
	 *
	 * @param currentOptions The options object with the pre-defined options.
	 * @return The options object on which the additional options are set.
	 */
	ColumnFamilyOptions createColumnOptions(ColumnFamilyOptions currentOptions);

}
{code}

What do you think?

> Potential resource leak in RocksDBStateBackend#getDbOptions
> -----------------------------------------------------------
>
>                 Key: FLINK-9735
>                 URL: https://issues.apache.org/jira/browse/FLINK-9735
>             Project: Flink
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: vinoyang
>            Priority: Minor
>
> Here is related code:
> {code}
>     if (optionsFactory != null) {
>       opt = optionsFactory.createDBOptions(opt);
>     }
> {code}
> opt, an DBOptions instance, should be closed before being rewritten.
> getColumnOptions has similar issue.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message