Apache Ignite org.apache.ignite.internal.client.thin.ClientProtocolError "Invalid response size" and "Unexpected response ID"

huangapple go评论77阅读模式
英文:

Apache Ignite org.apache.ignite.internal.client.thin.ClientProtocolError "Invalid response size" and "Unexpected response ID"

问题

我有一个在同一台服务器上的Docker化的Ignite实例和一个Docker化的Java程序。Ignite通过配置XML定义了一个缓存,Java通过一个轻量级客户端连接到它,缓存由另一个服务填充。Java只是从Ignite获取键值。

一切都按预期运行,但有时会出现错误,重新创建Java Docker容器可以解决它。但今天,Java开始在每次运行一段时间后显示这些错误,而且我无法解决它。已经尝试清空缓存或停止填充缓存的服务。

异常如下:

org.apache.ignite.internal.client.thin.ClientProtocolError: Unexpected response ID [4595132326738094176]
	at org.apache.ignite.internal.client.thin.TcpClientChannel.processNextResponse(TcpClientChannel.java:284)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.receive(TcpClientChannel.java:234)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.service(TcpClientChannel.java:171)
	at org.apache.ignite.internal.client.thin.ReliableChannel.service(ReliableChannel.java:180)
	at org.apache.ignite.internal.client.thin.ReliableChannel.affinityService(ReliableChannel.java:242)
	at org.apache.ignite.internal.client.thin.TcpClientCache.cacheSingleKeyOperation(TcpClientCache.java:509)
	at org.apache.ignite.internal.client.thin.TcpClientCache.get(TcpClientCache.java:111)
	at com.abc.rtpm.RtpmClient.getPrice(RtpmClient.java:63)

org.apache.ignite.internal.client.thin.ClientProtocolError: Invalid response size: -1476395008
	at org.apache.ignite.internal.client.thin.TcpClientChannel.processNextResponse(TcpClientChannel.java:275)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.receive(TcpClientChannel.java:234)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.service(TcpClientChannel.java:171)
	at org.apache.ignite.internal.client.thin.ReliableChannel.service(ReliableChannel.java:180)
	at org.apache.ignite.internal.client.thin.ReliableChannel.affinityService(ReliableChannel.java:242)
	at org.apache.ignite.internal.client.thin.TcpClientCache.cacheSingleKeyOperation(TcpClientCache.java:509)
	at org.apache.ignite.internal.client.thin.TcpClientCache.get(TcpClientCache.java:111)
	at com.abc.rtpm.RtpmClient.getPrice(RtpmClient.java:63)

客户端由以下代码创建:

this.cfg = new ClientConfiguration().setAddresses(clientHost + ":" + clientPort);
try {
    this.igniteClient = Ignition.startClient(this.cfg);
    this.cache = this.igniteClient.getOrCreateCache("rtpm");
}
catch (ClientException e) {
    System.err.println(e.getMessage());
}
catch (Exception e){
    System.err.format("Unexpected failure: %s\n", e);
}

有多个线程同时调用get方法。

非常感谢任何帮助。

英文:

I have a dockerized ignite instance and a dockerized java program in the same server. Ignite has a cache defined by the config xml and the java connects to it through a thin client and the cache is filled by another service. The java only does a get to ignite to get the key values.

Everything has been working as expected with this errors appearing sometimes and recreating the java docker resolved it. Today java started to show this errors every time, appearing after a few seconds of running under some load and I am not able to solve it. Already tried to empty the cache or to stop the service that fills it.

The exceptions are the following:

org.apache.ignite.internal.client.thin.ClientProtocolError: Unexpected response ID [4595132326738094176]
	at org.apache.ignite.internal.client.thin.TcpClientChannel.processNextResponse(TcpClientChannel.java:284)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.receive(TcpClientChannel.java:234)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.service(TcpClientChannel.java:171)
	at org.apache.ignite.internal.client.thin.ReliableChannel.service(ReliableChannel.java:180)
	at org.apache.ignite.internal.client.thin.ReliableChannel.affinityService(ReliableChannel.java:242)
	at org.apache.ignite.internal.client.thin.TcpClientCache.cacheSingleKeyOperation(TcpClientCache.java:509)
	at org.apache.ignite.internal.client.thin.TcpClientCache.get(TcpClientCache.java:111)
	at com.abc.rtpm.RtpmClient.getPrice(RtpmClient.java:63)

org.apache.ignite.internal.client.thin.ClientProtocolError: Invalid response size: -1476395008
	at org.apache.ignite.internal.client.thin.TcpClientChannel.processNextResponse(TcpClientChannel.java:275)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.receive(TcpClientChannel.java:234)
	at org.apache.ignite.internal.client.thin.TcpClientChannel.service(TcpClientChannel.java:171)
	at org.apache.ignite.internal.client.thin.ReliableChannel.service(ReliableChannel.java:180)
	at org.apache.ignite.internal.client.thin.ReliableChannel.affinityService(ReliableChannel.java:242)
	at org.apache.ignite.internal.client.thin.TcpClientCache.cacheSingleKeyOperation(TcpClientCache.java:509)
	at org.apache.ignite.internal.client.thin.TcpClientCache.get(TcpClientCache.java:111)
	at com.abc.rtpm.RtpmClient.getPrice(RtpmClient.java:63)

The client is created by the following code:

this.cfg = new ClientConfiguration().setAddresses(clientHost + ":" + clientPort);
try {
    this.igniteClient = Ignition.startClient(this.cfg);
    this.cache = this.igniteClient.getOrCreateCache("rtpm");
}
catch (ClientException e) {
    System.err.println(e.getMessage());
}
catch (Exception e){
    System.err.format("Unexpected failure: %s\n", e);
}

There are several threads calling the get simultaneously.

Any help is much appreciated.

答案1

得分: 0

我认为你使用了错误的端口。你应该使用 10800 或者 ClientConnectorConfiguration 指定的端口。

英文:

I think you are using a wrong port. You should use 10800 or the one specified by ClientConnectorConfiguration.

答案2

得分: 0

虽然在瘦客户端文档中提到它支持多线程,但似乎无法承受负载。

我通过使用常规客户端解决了这个问题。

英文:

Although in the thin client docs it says it supports multithreading it seems it cannot hold the load.

I solved this using a regular client.

huangapple
  • 本文由 发表于 2020年8月21日 00:30:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/63509423.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定