{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/107","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/107/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/107/events","html_url":"https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pull/107","id":378606082,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MjcwMDI4","number":107,"title":"Support new SocketFactory API in mysql-connector-java 8.0.13.","user":{"login":"anuraaga","id":198344,"node_id":"MDQ6VXNlcjE5ODM0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/198344?v=4","gravatar_id":"","url":"https://api.github.com/users/anuraaga","html_url":"https://github.com/anuraaga","followers_url":"https://api.github.com/users/anuraaga/followers","following_url":"https://api.github.com/users/anuraaga/following{/other_user}","gists_url":"https://api.github.com/users/anuraaga/gists{/gist_id}","starred_url":"https://api.github.com/users/anuraaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuraaga/subscriptions","organizations_url":"https://api.github.com/users/anuraaga/orgs","repos_url":"https://api.github.com/users/anuraaga/repos","events_url":"https://api.github.com/users/anuraaga/events{/privacy}","received_events_url":"https://api.github.com/users/anuraaga/received_events","type":"User","site_admin":false},"labels":[{"id":972796855,"node_id":"MDU6TGFiZWw5NzI3OTY4NTU=","url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/labels/Status:%20Review%20Needed","name":"Status: Review Needed","color":"fbca04","default":false},{"id":972794642,"node_id":"MDU6TGFiZWw5NzI3OTQ2NDI=","url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/labels/Type:%20Maintenance","name":"Type: Maintenance","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":{"login":"kurtisvg","id":31518063,"node_id":"MDQ6VXNlcjMxNTE4MDYz","avatar_url":"https://avatars3.githubusercontent.com/u/31518063?v=4","gravatar_id":"","url":"https://api.github.com/users/kurtisvg","html_url":"https://github.com/kurtisvg","followers_url":"https://api.github.com/users/kurtisvg/followers","following_url":"https://api.github.com/users/kurtisvg/following{/other_user}","gists_url":"https://api.github.com/users/kurtisvg/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtisvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtisvg/subscriptions","organizations_url":"https://api.github.com/users/kurtisvg/orgs","repos_url":"https://api.github.com/users/kurtisvg/repos","events_url":"https://api.github.com/users/kurtisvg/events{/privacy}","received_events_url":"https://api.github.com/users/kurtisvg/received_events","type":"User","site_admin":false},"assignees":[{"login":"kurtisvg","id":31518063,"node_id":"MDQ6VXNlcjMxNTE4MDYz","avatar_url":"https://avatars3.githubusercontent.com/u/31518063?v=4","gravatar_id":"","url":"https://api.github.com/users/kurtisvg","html_url":"https://github.com/kurtisvg","followers_url":"https://api.github.com/users/kurtisvg/followers","following_url":"https://api.github.com/users/kurtisvg/following{/other_user}","gists_url":"https://api.github.com/users/kurtisvg/gists{/gist_id}","starred_url":"https://api.github.com/users/kurtisvg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kurtisvg/subscriptions","organizations_url":"https://api.github.com/users/kurtisvg/orgs","repos_url":"https://api.github.com/users/kurtisvg/repos","events_url":"https://api.github.com/users/kurtisvg/events{/privacy}","received_events_url":"https://api.github.com/users/kurtisvg/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2018-11-08T07:14:58Z","updated_at":"2018-11-08T17:51:52Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pulls/107","html_url":"https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pull/107","diff_url":"https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pull/107.diff","patch_url":"https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pull/107.patch"},"body":"mysql-connector-java 8.0.13 introduced a major backwards incompatible change in the `SocketFactory` API. This makes sure the cloud SocketFactory implements both old and new APIs.\r\n\r\n```\r\nException in thread \"main\" java.lang.AbstractMethodError: Receiver class com.google.cloud.sql.mysql.SocketFactory does not define or inherit an implementation of the resolved method abstract connect(Ljava/lang/String;ILcom/mysql/cj/conf/PropertySet;I)Ljava/io/Closeable; of interface com.mysql.cj.protocol.SocketFactory.\r\n\tat com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:65)\r\n\tat com.mysql.cj.NativeSession.connect(NativeSession.java:152)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:955)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:825)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:455)\r\n\tat com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)\r\n\tat com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:207)\r\n\tat com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:136)\r\n\tat com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)\r\n\tat com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)\r\n\tat com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)\r\n\tat com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)\r\n\tat com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)\r\n\r\n```\r\n\r\nI verified the change on the three GA releases, 8.0.11, 8.0.12, and 8.0.13.\r\n\r\nI ran into a strange behavior of Java, I believe, where previously it was fine to implicitly implement a method that returns `<T extends Closeable> T` with a method that returns `Socket`, but from what I can tell it only works when compiling a class that actually implements the interface (guess Java generates bytecode for the concrete and `Closeable` version when it sees such an interface override). Now that the method stopped having an interface method it was implementing, such a helper wasn't generated and I couldn't get the new code to run on `8.0.11` until changing the signature from `Socket` to `<T extends Closeable> T`. Since this is actually closer to the definition in `8.0.11`, it is a compatible change."},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/comments/437094443","html_url":"https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/pull/107#issuecomment-437094443","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/issues/107","id":437094443,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzA5NDQ0Mw==","user":{"login":"anuraaga","id":198344,"node_id":"MDQ6VXNlcjE5ODM0NA==","avatar_url":"https://avatars0.githubusercontent.com/u/198344?v=4","gravatar_id":"","url":"https://api.github.com/users/anuraaga","html_url":"https://github.com/anuraaga","followers_url":"https://api.github.com/users/anuraaga/followers","following_url":"https://api.github.com/users/anuraaga/following{/other_user}","gists_url":"https://api.github.com/users/anuraaga/gists{/gist_id}","starred_url":"https://api.github.com/users/anuraaga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuraaga/subscriptions","organizations_url":"https://api.github.com/users/anuraaga/orgs","repos_url":"https://api.github.com/users/anuraaga/repos","events_url":"https://api.github.com/users/anuraaga/events{/privacy}","received_events_url":"https://api.github.com/users/anuraaga/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T17:51:52Z","updated_at":"2018-11-08T17:51:52Z","author_association":"CONTRIBUTOR","body":"Oops sorry had meant to link to this commit.\r\n\r\nhttps://github.com/mysql/mysql-connector-j/commit/3f44adb9bbf6d53528294e0668874724df8edd4e#diff-a8538d4116e1db5fe21f876c58fc1360\r\n\r\nUnfortunately don't know of any other discussion besides it.\r\n\r\nAlso sorry for the poor explanation of `T extends Closeable` and `Socket` - TBH I'm not totally sure either. What I found was when compiling vs 8.0.13, even though the old method was completely unchanged, 8.0.12 could not find the method at runtime - changing the return type to be exactly the same as in 8.0.12, `T extends Closeable`, fixed it. I can only presume that javac generates code differently when a method \"partially matches\" an interface method compared to when the method is defined by itself, but it's behavior I've never heard of before."}}
{"actor":{"display_login":"anuraaga"}}