You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Mikhail Cherkasov (JIRA)" <ji...@apache.org> on 2018/01/19 00:41:13 UTC
[jira] [Commented] (IGNITE-2766) Cache instance is closed when
client disconnects
[ https://issues.apache.org/jira/browse/IGNITE-2766?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331514#comment-16331514 ]
Mikhail Cherkasov commented on IGNITE-2766:
-------------------------------------------
I can reproduce the issue with the following test:
{code:java}
package multiplan;
import java.util.Arrays;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.Ignition;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.configuration.IgniteConfiguration;
import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.TcpDiscoveryVmIpFinder;
import org.jetbrains.annotations.NotNull;
public class ReconnectClient {
private static int id;
public static void main(String[] args) throws InterruptedException {
Ignition.setClientMode(false);
Ignite server = Ignition.start(getConfiguration());
Ignition.setClientMode(true);
Ignite client = Ignition.start(getConfiguration());
IgniteCache<String, String> cache = client.cache("TEST");
cache.put("Hello", "World");
server.close();
Thread.sleep(2_000);
Ignition.setClientMode(false);
server = Ignition.start(getConfiguration());
Thread.sleep(4_000);
System.out.println(cache.get("Hello"));
cache.put("Ping", "Pong");
System.out.println("DONE");
}
@NotNull private static IgniteConfiguration getConfiguration() {
IgniteConfiguration cfg = new IgniteConfiguration();
TcpDiscoveryVmIpFinder finder = new TcpDiscoveryVmIpFinder(true);
finder.setAddresses(Arrays.asList("localhost:47500..47600"));
cfg.setIgniteInstanceName("test" + id++);
cfg.setCacheConfiguration(new CacheConfiguration("TEST"));
cfg.setDiscoverySpi( new TcpDiscoverySpi().setIpFinder(finder));
return cfg;
}
}
{code}
> Cache instance is closed when client disconnects
> ------------------------------------------------
>
> Key: IGNITE-2766
> URL: https://issues.apache.org/jira/browse/IGNITE-2766
> Project: Ignite
> Issue Type: Bug
> Components: cache
> Affects Versions: 1.5.0.final
> Reporter: Valentin Kulichenko
> Assignee: Ilya Kasnacheev
> Priority: Major
>
> In case client disconnects and reconnects after network timeout (i.e., with a new ID), all cache instances acquired by this client are closed and are not functional. User has to create a special logic to handle this case.
> Cache proxy should be able to handle this automatically.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)