Error Message
When encountering a network issue, the following error is generally returned in ArcGIS Server logs.
"Unable to process request. java.net.SocketException: Connection reset by peer: socket write error"
Cause
The following are possible causes for the error:
- The error occurs when a connection is closed abruptly (when a TCP connection is reset while there is still data in the send buffer). The condition is very similar to a much more common ‘Connection reset by peer’. It can happen sporadically when connecting over the Internet, but also systematically if the timing is right (for example, with keep-alive connections on localhost).
- The Transmission Control Protocol (TCP) socket is closed because the socket received a close command from a remote database machine.
- A Reset (RST) packet is received from a remote machine and interrupts the established connection. The sent RST packets may indicate that the TCP packets sent are not recognized, a connection between the local and remote database machine is broken, or a particular port is closed and is not allowing communication.
- There is a timeout or a restart of the remote database. If there is an idle timeout or if the machine with the database is restarted, the database becomes unreachable.
Solution or Workaround
Run the ping command to determine if the remote machine is reachable.
- Navigate to Windows Start.
- Type cmd in the Search programs and files search bar.
- Click cmd from the search results.
- In the command line, type ping followed by the remote server address, and press Enter. The following is an example of a successful ping request.
Note: Even if the results are successful, there are instances where the target machine does not respond and can still return a successful ping result. The data returned can help determine if there are any communication issues between the remote machine and the local machine.
- Run the tracert command to diagnose if and where the lapse in communications is happening:
- Follow Steps 1 through 3 from above.
- For Step 4, in the command line, type tracert followed by the destination address, and press Enter. The following is an example of a successful tracert request.
Note: The tracert command is similar to the ping command; however, the tracert command displays in detail all the routes taken to establish a connection with the target machine.
- Run the telnet command to check if the ports are open on the local machine.
- Follow Steps 1 through 3 from above.
- For Step 4, in the command line, type telnet, followed by the destination address. This can be the local computer name or IP address, followed by the port number. Press Enter.
Note: If successful, the screen turns blank, indicating the port is open; however, if the port is closed, the following message is returned.
Note: The telnet feature can be enabled on a Windows machine by navigating to Windows Start > Control Panel > Programs (and Features). On the left sidebar, click Turn Windows features on or off, and ensure the Telnet Client check box is checked. Click OK.
- Run SDEINTERCEPT to diagnose ArcSDE performance and connection issues. The following technical document describes this process in detail:
HowTo: Diagnose ArcSDE connection and performance issues using SDEINTERCEPT.Note: If the cause of the issue is identified to be the database server, contact a database administrator (DBA) for further troubleshooting.
Related Information
- ArcGIS for Server: Ports used by ArcGIS Server
- ArcGIS for Server: Configuring a secure environment for ArcGIS Server
- Esri: Tracing ArcSDE Queries with SQL Profiler
- Official reasons for “Software caused connection abort: socket write error”
- StackOverflow Thread: java.net.SocketException: Software caused connection abort: recv failed
- HowTo: Diagnose ArcSDE connection and performance issues using SDEINTERCEPT
Last Published: 5/9/2019
Article ID: 000012876
Software: ArcGIS GeoEvent Server 10.3.1, 10.3 ArcGIS Image Server 10.3.1, 10.3 ArcGIS Server 10.3.1, 10.3
Hi.
My Java Web application which is working under Apache Tomcat 5.0.28 gives following error message
when users try to login to the system.
Error message
———————————————————————————————————————————————
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: 「鯱シヤエセナメエ IO: Connection reset by peer: socket write error
java.sql.SQLException: 「鯱シヤエセナメエ IO: Connection reset by peer: socket write error
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
at oracle.jdbc.driver.OracleConnection.setAutoCommit(OracleConnection.java:1224)
at org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnection.java:331)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.setAutoCommit(PoolingDataSource.java:317)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:282)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:225)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:89)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:643)
at jp.co.vmi.business.login.EasyQuery$$EnhancerByCGLIB$$b0ebbda8.getWarehouseCd(<generated>)
at jp.co.vmi.business.login.EasyAction.setWarehouseCd(EasyAction.java:275)
at jp.co.vmi.business.login.EasyAction.toLoginPage(EasyAction.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at jp.co.vmi.frame.web.action.BaseDispatchAction.execute(BaseDispatchAction.java:81)
at org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at jp.co.vmi.frame.web.servlet.CharsetEncodingFilter.doFilter(CharsetEncodingFilter.java:42)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Thread.java:534)
———————————————————————————————————————————————
When this happens, users cannot login.
But after I restart Tomcat, the whole system works fine but the same problem occurs again after a few hours .
I asked server administrator if they’ve changed App and/or DB server configurations but they say No.
I’ve looked into similar threads but could not find suitable solutions.
Any ideas??
This is my first post and I’m newvie.
If information is not enough please let me know.
Thanks
Пытаюсь задеплоить war с помощью tomcat7:deploy на Tomcat.
Все делаю по инструкции с сайта https://mkyong.com/maven/how-to-deploy-maven-based…
На локальном компе все деплоится на ура.
А на удаленный сервер возникает ошибка:
Cannot invoke Tomcat manager: Connection reset by peer: socket write error
tomcat-users.xml
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
...
<role rolename="admin"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<role rolename="manager-status"/>
<user username="user" password="pwd" roles="admin,manager-gui,manager-script,manager-jmx,manager-status"/>
</tomcat-users>
В .m2/settings.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>ds</id>
<username>user</username>
<password>pwd</password>
</server>
</servers>
</settings>
В pom.xm
<build>
<finalName>telecom</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<update>true</update>
<server>ds</server>
<url>http://192.168.115.200:8080/manager/text</url>
</configuration>
</plugin></b>
</plugins>
</pluginManagement>
</build>
Запускаю:
mvn tomcat7:deploy
Получаю:
[INFO] — tomcat7-maven-plugin:2.2:deploy (default-cli) @ telecom —
[INFO] Deploying war to 192.168.115.200:8080/telecom
Uploading: 192.168.115.200:8080/manager/text/deploy?path=%2Ft…
2186/26839 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: 192.168.115.200:8080/manager/text/deploy?path=%2Ft…
2184/26839 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: 192.168.115.200:8080/manager/text/deploy?path=%2Ft…
2184/26839 KB
[INFO] I/O exception (java.net.SocketException) caught when processing request: Connection reset by peer: socket write error
[INFO] Retrying request
Uploading: 192.168.115.200:8080/manager/text/deploy?path=%2Ft…
2186/26839 KB
[INFO] ————————————————————————
[INFO] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Total time: 12.500 s
[INFO] Finished at: 2020-04-18T01:45:42+03:00
[INFO] Final Memory: 29M/279M
[INFO] ————————————————————————
[ERROR] Failed to execute goal org.apache.tomcat.maven:tomcat7-maven-plugin:2.2:deploy (default-cli) on project telecom: Cannot invoke Tomcat manager: Connection reset by peer: socket write error -> [Help 1]
Размер war 27 Mb
Уже не знаю куда куда копать..
Гуглил, все возможные ошибки изучил…
when write 50w data(something like:a hashmap includes 50w row) to redis server,it works.
but when i write 55w data to redis server,this exception has been throwed.
at first,i think it’s caused by timeout,but i set maxtimewait from 1000*1000 to -1, it also doesn’t work.
then i think there is not enough memery,but i change env to my local, my local mem is 8g,and redisconf’s [maxmemory] is default not be set,so i think the problom is not here,
at last,i have changed env to my local,and it also doesn’t work,so i think the reason is not on server,it maybe client’s problem,i really can’t not understand why it doesn’t work.help!
jedis version is:2.2.1,(2.6.0 also)
redis info:
Server
redis_version:2.8.4
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:c727d0517b021f2
redis_mode:standalone
os:Linux 2.6.32-431.el6.x86_64 x86_64
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.7
process_id:2852
run_id:0294dde7a8ea2b23ddd86069d62752a0a33
tcp_port:6379
uptime_in_seconds:12528
uptime_in_days:0
hz:10
lru_clock:2050369
config_file:/usr/local/redis/conf/redis.co
Clients
connected_clients:7
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0
Memory
used_memory:9235096
used_memory_human:8.81M
used_memory_rss:17690624
used_memory_peak:80723800
used_memory_peak_human:76.98M
used_memory_lua:33792
mem_fragmentation_ratio:1.92
mem_allocator:jemalloc-3.2.0
Persistence
loading:0
rdb_changes_since_last_save:1
rdb_bgsave_in_progress:0
rdb_last_save_time:1425595531
rdb_last_bgsave_status:ok
rdb_last_bgsave_time_sec:0
rdb_current_bgsave_time_sec:-1
aof_enabled:0
aof_rewrite_in_progress:0
aof_rewrite_scheduled:0
aof_last_rewrite_time_sec:-1
aof_current_rewrite_time_sec:-1
aof_last_bgrewrite_status:ok
Stats
total_connections_received:192
total_commands_processed:892515
instantaneous_ops_per_sec:0
rejected_connections:0
sync_full:0
sync_partial_ok:0
sync_partial_err:0
expired_keys:6
evicted_keys:0
keyspace_hits:3559
keyspace_misses:188
pubsub_channels:0
pubsub_patterns:0
latest_fork_usec:12960
Replication
role:master
connected_slaves:0
master_repl_offset:0
repl_backlog_active:0
repl_backlog_size:1048576
repl_backlog_first_byte_offset:0
repl_backlog_histlen:0
CPU
used_cpu_sys:141.56
used_cpu_user:32.85
used_cpu_sys_children:1.75
used_cpu_user_children:3.52
Keyspace
db0:keys=21715,expires=18,avg_ttl=20991829
i met the problem the same, more of 500 thousands of data in hashmap write failed with exception
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: Connection reset by peer: socket write error
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:94)
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:74)
at redis.clients.jedis.Connection.sendCommand(Connection.java:78)
at redis.clients.jedis.BinaryClient.hmset(BinaryClient.java:242)
at redis.clients.jedis.Client.hmset(Client.java:158)
at redis.clients.jedis.Jedis.hmset(Jedis.java:631)
at com.axon.scene.RedisHmsetTest.main(RedisHmsetTest.java:114)
Caused by: java.net.SocketException: Connection reset by peer: socket write error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at redis.clients.util.RedisOutputStream.flushBuffer(RedisOutputStream.java:31)
at redis.clients.util.RedisOutputStream.write(RedisOutputStream.java:53)
at redis.clients.util.RedisOutputStream.write(RedisOutputStream.java:44)
at redis.clients.jedis.Protocol.sendCommand(Protocol.java:90)
maybe the buffer in RedisOuputStream is full, default is 8K,nor do i know the sulotion to solve it .
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import redis.clients.jedis.Jedis;
import com.google.gson.Gson;
public class RedisHmsetTest {
public static class DataModel {
private int cid = 0;
private List map = new ArrayList();
public List getMap() {
return map;
}
public void setMap(List map) {
this.map = map;
}
}
public static class TTMap {
private int tid;
private long tm;
public long getTm() {
return tm;
}
public void setTm(long tm) {
this.tm = tm;
}
public TTMap(int tid, long tm) {
this.tid = tid;
this.tm = tm;
}
}
public static void main(String[] args) throws UnsupportedEncodingException {
long pCnt = 2500000L;
int tCnt = 4;
Gson gson = new Gson();
long t1,t2,t3,t4,t5;
Map<String, String> sttg = new HashMap<String, String>((int) pCnt);
Map<Long, DataModel> rsttg = new HashMap<Long, RedisHmsetTest.DataModel>();
long tm = System.currentTimeMillis() / 1000;
t1 = System.currentTimeMillis();
for (long p=100001569758007822L; p<100001569758007822L+pCnt; p++) {
DataModel d = new DataModel();
for (int t=180000; t<180000+tCnt; t++) {
d.getMap().add(new TTMap(t, tm + t));
}
sttg.put(String.valueOf(p), gson.toJson(d, DataModel.class));
}
t2 = System.currentTimeMillis();
System.out.println(String.format("generate %d items to sttg use %d ms", pCnt, t2 - t1));
Jedis jedis = null;
try {
jedis = RedisPool.getJedis();
System.out.println(jedis.hmset("RedisHmsetTest", sttg));
t3 = System.currentTimeMillis();
System.out.println(String.format("write %d items from sttg use %d ms", sttg.size(), t3 - t2));
Map<String, String> mm = jedis.hgetAll("RedisHmsetTest");
t4 = System.currentTimeMillis();
System.out.println(String.format("read %d items from sttg use %d ms", mm.size(), t4 - t3));
for (Map.Entry<String, String> entry : mm.entrySet()) {
rsttg.put(Long.valueOf(entry.getKey()), gson.fromJson(entry.getValue(), DataModel.class));
}
t5 = System.currentTimeMillis();
System.out.println(String.format("load %d items to rsttg use %d ms", mm.size(), t5 - t4));
} catch (Exception e) {
e.printStackTrace();
} finally {
RedisPool.returnResource(jedis);
}
}
}
i used the JedisPool with the default configuration except the timeout, what is like below:
new JedisPool(config, ProcessConfig.getInstance().getProperty(«redisIp»), Integer.valueOf(ProcessConfig.getInstance().getProperty(«redisPort»)), 60 * 1000);
import java.io.IOException;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;
public class RedisPool {
private static JedisPool pool = null;
public static synchronized Jedis getJedis() throws NumberFormatException, IOException {
if (pool == null) {
JedisPoolConfig config = new JedisPoolConfig();
pool = new JedisPool(config, ProcessConfig.getInstance().getProperty("redisIp"), Integer.valueOf(ProcessConfig.getInstance().getProperty("redisPort")), 60 * 1000);
}
return pool.getResource();
}
public static synchronized void returnResource(Jedis jedis) {
if (jedis != null) {
pool.returnResource(jedis);
}
}
}
@marcosnils
@lquterqtd
Thanks for sharing!
Seems like you doesn’t handle connection exception while returning instance to Pool.
Did you set timeout to Redis configuration? It means that Redis will disconnect connections with idle timeout.
@HeartSaVioR @marcosnils
do you mean the timeout configuration on the server?
i used the default «timeout 0».
in the exception block i should use returnBrokenResource method?
i don’t think i need to use jedis.close() in the finally block. returnResource is just enough.
i will modify the exception block and try again.
@lquterqtd returnResource
and returnBrokenResource
are deprecated in 2.6 and 2.7. You need to use jedis.close()
in the finally block.
i used 2.6.2 and i mentioned the source code, jedis.close() is implemented:
@OverRide
public void close() {
if (dataSource != null) {
if (client.isBroken()) {
this.dataSource.returnBrokenResource(this);
} else {
this.dataSource.returnResource(this);
}
} else {
client.close();
}
}
i did not find the deprecated tag over the returnResource method.
@marcosnils thanks a lot, i read the part of the wiki.i will try later.
@lquterqtd I just run your code locally and after tuning the JVM Heap and GCOvearHeadLimit it passed without problems. I used redis 2.8.19 and Jedis 2.6.3.
It took a while to complete but I didn’t get any exception. I used a redis server with the default configuration.
Looking at your stacktrace seems like redis is closing the connections for some reason. I’d recommend setting your redis logs to «DEBUG» and see if it complains there.
Another thing to notice is that the way you’re calling hmset is not optimal in terms of memory and performance because you’re basically generating a huge stream chunk and sending all the data to redis at once. I’d recommend using pipeline and batching the inserts to reduce the memory footprint and improve the insertion times.
@antirez is there a max limit in terms of key — value pairs that hmset
can handle?. @lquterqtd is trying to hmset 5M items (keys + values) in a single redis operation and for some reason as soon as Jedis is starting to write into the socket we get a Broken pipe
exception which I’ve confirmed is redis closing the client connection.
I have checked and the query buffer limit (http://redis.io/topics/clients#query-buffer-hard-limit) is not being reached. I’ve also set the loglevel to DEBUG and I see redis disconnecting the client before getting the exception from the java side but it doesn’t say anything why it’s disconnecting it.
@antirez @lquterqtd @HeartSaVioR just reproduced it making a simple python / telnet program.
if you set the total
variable any number higher than 524287 you’ll get the Broken pipe error.
I guess this might be some redis/os limit we’re hitting. I’ve tried looking in the redis documentation but I didn’t find anything about it.
This happens with all version of Redis.
import telnetlib start = 100001569758007822 value = '{"cid":0,"map":[{"tid":180000,"tm":1431560060},{"tid":180001,"tm":1431560061},{"tid":180002,"tm":1431560062},{"tid":180003,"tm":1431560063}]}' total = 2500000 redis_total = total * 2 + 2 tn = telnetlib.Telnet("localhost", 6379) tn.write("*"+str(redis_total)+"rn$5rnHMSETrn$14rnRedisHmsetTestrn") for x in range(start, start + total ): key = str(x) tn.write("$"+str(len(key))+"rn") tn.write(key) tn.write("rn") tn.write("$"+str(len(value))+"rn") tn.write(value+"rn") print tn.read_some() tn.close()
@lquterqtd @marcosnils
This is not about connection but about limitation of multibulk size.
Redis restrict maximum size of multibulk as (1024 * 1024).
https://github.com/antirez/redis/blob/unstable/src/networking.c#L1023-1027
I could confirm this by tcpdump.
09:17:27.740553 IP localhost.53053 > localhost.6379: Flags [P.], seq 1:8191, ack 1, win 12759, options [nop,nop,TS val 404996303 ecr 404994609], length 8190
E. 2..@.@............=..0....9mX..1..'.....
.#...#.1*1048578 <---- exceed limitation
$5
HMSET
$14
RedisHmsetTest
$18
100001569758228599
$18
09:17:27.740797 IP localhost.6379 > localhost.53053: Flags [P.], seq 1:48, ack 8191, win 12503, options [nop,nop,TS val 404996303 ecr 404996303], length 47
E..cg.@.@..............=.9mX0.:...0..W.....
.#...#..-ERR Protocol error: invalid multibulk length <-- protocol error
... omitted ...
09:17:27.740865 IP localhost.6379 > localhost.53053: Flags [R], seq 238644616, win 0, length 0
E..(..@.@..............=.9m.....P....... <-- RST
So in this case, limitation of max key/value pair if 524288, (1024*1024) / 2.
I thought two action items from this
- Check multibulksize before write to output stream. Maybe
Protocol.sendCommand
is good point. - From tcpdump Redis send RESP Errors before reset connection. So in erronouse case, we can check intput stream to show reason of error.
If agreed, I’ll send PR for these.
@itugs thanks for the investigation, do you know if that is documented somewhere in the redis docs?, I couldn’t find it. @HeartSaVioR realized that if you use the «VERBOSE» logevel you can see the error in redis logs (weird that in DEBUG it doesn’t show up, @antirez is this possible?).
@itugs regarding to your propositions I believe i’d only do number 2 so if redis limitation changes in the future we don’t need to change anything from the Jedis side. What do you think?
I posted strange logging behavior to Redis repo.
@marcosnils No I could not found any docs about that. As you said I check tcpdump because I could not see any log from redis log. And even «VERBOSE» we can not see specific reason of error, like invalid multibulk length
. I think it’s better to print out specific reason to redis log, but I don’t know if this is spec.
About propositions, yes I agree with you. If number two is done, number one is not a big deal. About number 1, I wanna hear the reason of that limitation. @antirez could you tell us about the number?
@marcosnils i just read the @itugs investigation, the problem is that in server side multibulk size is limit to 1024*1024, is that right?
I will use pipeline or batch inserts to have a try.
See if your redis is running in protected mode, disable the protected mode
Issue
In the instance error.log, you have errors similar to the following:
*ERROR* delivery: doFinalize: java.net.SocketException: Connection reset by peer: socket write error
Solution
You can ignore this error.
Additional information
This error occurs when the connection is dropped while Communiqué is sending data back to the browser. There are some possible scenarios:
- The user cancels the request.
- The browser cancels the request, which serves the page from the browser cache.