You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "王江洲 (Jira)" <ji...@apache.org> on 2023/08/08 13:10:00 UTC
[jira] [Updated] (FLINK-32812) HBaseRowDataLookupFunction HTable instantiation of thread safety problems
[ https://issues.apache.org/jira/browse/FLINK-32812?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
王江洲 updated FLINK-32812:
------------------------
Docs Text: HBaseRowDataLookupFunction HTable instantiation thread safety problems, in the open () method of initialization HTable, but in the actual development environment, the program has been performed, the close () method of the large probability can't perform, result in Ttable cannot be shut down, Subsequent programs all use the same Ttable, which poses a multi-thread security risk, resulting in data errors.
Environment:
{color:#4c9aff}Flink 1.17.1{color}
{color:#4c9aff}Hbase 2.4.11{color}
@Override
public void open(FunctionContext context) {
LOG.info("start open ...");
Configuration config = prepareRuntimeConfiguration();
try
{ hConnection = ConnectionFactory.createConnection(config);
{color:#de350b}table = (HTable) hConnection.getTable(TableName.valueOf(hTableName));{color} }
catch (TableNotFoundException tnfe) {
LOG.error("Table '{}' not found ", hTableName, tnfe);
throw new RuntimeException("HBase table '" + hTableName + "' not found.", tnfe);
} catch (IOException ioe)
{ LOG.error("Exception while creating connection to HBase.", ioe); throw new RuntimeException("Cannot create connection to HBase.", ioe); }
this.serde = new HBaseSerde(hbaseTableSchema, nullStringLiteral);
LOG.info("end open.");
}
was:
Flink 1.17.1
Hbase 2.4.11
@Override
public void open(FunctionContext context) {
LOG.info("start open ...");
Configuration config = prepareRuntimeConfiguration();
try {
hConnection = ConnectionFactory.createConnection(config);
table = (HTable) hConnection.getTable(TableName.valueOf(hTableName));
} catch (TableNotFoundException tnfe) {
LOG.error("Table '{}' not found ", hTableName, tnfe);
throw new RuntimeException("HBase table '" + hTableName + "' not found.", tnfe);
} catch (IOException ioe) {
LOG.error("Exception while creating connection to HBase.", ioe);
throw new RuntimeException("Cannot create connection to HBase.", ioe);
}
this.serde = new HBaseSerde(hbaseTableSchema, nullStringLiteral);
LOG.info("end open.");
}
> HBaseRowDataLookupFunction HTable instantiation of thread safety problems
> -------------------------------------------------------------------------
>
> Key: FLINK-32812
> URL: https://issues.apache.org/jira/browse/FLINK-32812
> Project: Flink
> Issue Type: Bug
> Components: Connectors / HBase
> Affects Versions: 1.17.1
> Environment: {color:#4c9aff}Flink 1.17.1{color}
> {color:#4c9aff}Hbase 2.4.11{color}
> @Override
> public void open(FunctionContext context) {
> LOG.info("start open ...");
> Configuration config = prepareRuntimeConfiguration();
> try
> { hConnection = ConnectionFactory.createConnection(config);
> {color:#de350b}table = (HTable) hConnection.getTable(TableName.valueOf(hTableName));{color} }
> catch (TableNotFoundException tnfe) {
> LOG.error("Table '{}' not found ", hTableName, tnfe);
> throw new RuntimeException("HBase table '" + hTableName + "' not found.", tnfe);
> } catch (IOException ioe)
> { LOG.error("Exception while creating connection to HBase.", ioe); throw new RuntimeException("Cannot create connection to HBase.", ioe); }
> this.serde = new HBaseSerde(hbaseTableSchema, nullStringLiteral);
> LOG.info("end open.");
> }
> Reporter: 王江洲
> Priority: Minor
> Labels: security
> Fix For: 1.17.1
>
>
> HBaseRowDataLookupFunction HTable instantiation of thread safety problems in the actual development environment, the program has been performed, the close () method of the large probability can't perform, result in Ttable cannot be shut down, all use the same Ttable subsequent applications, multithreading safety hazard, Data errors occur.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)