golang-neo4j-bolt-driver icon indicating copy to clipboard operation
golang-neo4j-bolt-driver copied to clipboard

Fix for connectionNilOrClosed detects a fail in socket communication

Open alexwbaule opened this issue 6 years ago • 3 comments

This is a fix for reading a closed connection or failed connection, that must be reconnect, but with the older implementation, don't work.

Looking for "read([]byte{0})" that is used to identify a "stalled" connection, i found this Bug in Go: https://github.com/golang/go/issues/10940 and https://github.com/golang/go/issues/15735, and finally came to here https://github.com/go-sql-driver/mysql/blob/master/conncheck.go.

alexwbaule avatar Jun 06 '19 22:06 alexwbaule

Looks like a much more robust way of resetting connections when they go idle.

collisonchris avatar Jun 19 '19 03:06 collisonchris

I don't believe that this can be merged for copyright reasons. This project is MIT licensed, while the go-sql-driver code in question is MPL licensed.

The MPL requires that other code in the same files is also MPL or GPL.

To use that code, I think you need to do one of the following:

  1. Get permission of the original author of it to use it under the MIT license
  2. Re-license this project to be GPL or MPL
  3. Contain the MPL licensed portion in one package/file by itself, reference it from other files, distribute the MPL license in addition to the MIT license in this project (see their virality FAQ).

The 3rd option seems like it's the easiest to go with.

Usual internet disclaimer, I'm not a lawyer, this is not legal advice, etc etc.

euank avatar Jun 21 '19 23:06 euank

Yikes. I didn't even notice the license difference.

Agree on the 3rd option being the easiest.

collisonchris avatar Jun 24 '19 18:06 collisonchris