flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chesnay Schepler (JIRA)" <j...@apache.org>
Subject [jira] [Created] (FLINK-8057) KvStateRegistry#registerKvState may randomly fail
Date Mon, 13 Nov 2017 14:53:00 GMT
Chesnay Schepler created FLINK-8057:

             Summary: KvStateRegistry#registerKvState may randomly fail
                 Key: FLINK-8057
                 URL: https://issues.apache.org/jira/browse/FLINK-8057
             Project: Flink
          Issue Type: Improvement
          Components: Queryable State
    Affects Versions: 1.4.0
            Reporter: Chesnay Schepler

The {{KvStateRegistry#registerKvState}} method is a bit weird. On each call, a new KvStateID
is generated, and we then check whether a state for this ID was already registered. Realistically,
this is never the case making the check unnecessary, and on the off-chance that it does happen
the job will fail for no good reason.

KvStateID kvStateId = new KvStateID();

if (registeredKvStates.putIfAbsent(kvStateId, kvState) == null) {
	KvStateRegistryListener listener = this.listener.get();
	if (listener != null) {

	return kvStateId;
} else {
	throw new IllegalStateException(kvStateId + " is already registered.");

This message was sent by Atlassian JIRA

View raw message