Hello,
We have an Android application that stores data on the tablet using Jedis. In order to debug the application, we have an ethernet cable connected between the tablet and the laptop with USB to ethernet dongles on each end. We then can debug using Android Studio over ADB.
While debugging, if I remove one of the USB dongles, the application will continue to run. However, I have a Jedis connection that becomes permanently broken. I'm seeing a stack trace that looks like this when we try to use the connection:
Stack trace:
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketException: socket failed: ENONET (Machine is not on the network)
at redis.clients.jedis.Connection.connect(Connection.java:207)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93)
at redis.clients.jedis.Connection.sendCommand(Connection.java:126)
at redis.clients.jedis.BinaryClient.hgetAll(BinaryClient.java:294)
at redis.clients.jedis.Client.hgetAll(Client.java:222)
at redis.clients.jedis.Jedis.hgetAll(Jedis.java:847)
.
.
.
Caused by: java.net.SocketException: socket failed: ENONET (Machine is not on the network)
at java.net.Socket.createImpl(Socket.java:492)
at java.net.Socket.getImpl(Socket.java:552)
at java.net.Socket.setReuseAddress(Socket.java:1493)
at redis.clients.jedis.Connection.connect(Connection.java:174)
at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93)
at redis.clients.jedis.Connection.sendCommand(Connection.java:126)
at redis.clients.jedis.BinaryClient.hgetAll(BinaryClient.java:294)
at redis.clients.jedis.Client.hgetAll(Client.java:222)
at redis.clients.jedis.Jedis.hgetAll(Jedis.java:847)
I attempted to close/disconnect the connection and then reconnect, but that also doesn't resolve the issue. The only way to restore the connection is to stop and restart the app.
Has anyone else seen this problem and is there a workaround? We are currently using Jedis 2.9.0 on Android SDK 28.
Thanks,
Mark