Skip to content

DomainSocket support - #285

Closed
czp3009 wants to merge 8 commits into
jasync-sql:masterfrom
czp3009:master
Closed

czp3009 wants to merge 8 commits into
jasync-sql:masterfrom
czp3009:master

Conversation

@czp3009

@czp3009 czp3009 commented Feb 13, 2022

Copy link
Copy Markdown
Contributor

This PR aims to implement support for DomainSockets, using code from #176.

But the test code still has some problems. Since the project's dependencies do not include "netty-transport-native-epoll", the Epoll class does not exist even when test on Linux system. Thus, NettyUtils always chose NioSocketChannel.

But adding "netty-transport-native-epoll" to the dependency will cause some tests for NettyUtils to fail because they are hard-coded and the test code will always determine if NioSocketChannel is returned.

I'm confused about how to test all the code, both without the domain socket and with it. Further, in order to test domain sockets, then all test code may not work on some systems, such as Windows.

andy-yx-chen and others added 7 commits January 2, 2020 15:32
@oshai

oshai commented Feb 13, 2022

Copy link
Copy Markdown
Contributor

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

import com.github.jasync.sql.db.mysql.message.server.PreparedStatementPrepareResponse
import com.github.jasync.sql.db.mysql.message.server.ResultSetRowMessage
import com.github.jasync.sql.db.mysql.message.server.ServerMessage
import com.github.jasync.sql.db.mysql.message.client.*

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please refrain from using star imports

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My IDEA with default JetBrains code style automatic format to *, could you please provide your code style xml so i can import to my IDEA.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@czp3009

czp3009 commented Feb 14, 2022

Copy link
Copy Markdown
Contributor Author

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

@oshai

oshai commented Feb 14, 2022

Copy link
Copy Markdown
Contributor

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

@czp3009

czp3009 commented Feb 14, 2022

Copy link
Copy Markdown
Contributor Author

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

There may be some misunderstanding, I am not asking how to read and set system properties. I want to know what "forceNioSocket" or "forceDomainSocket" does, and what documentation they are described in.

Obviously, they are not java standard system properties.

@oshai

oshai commented Feb 14, 2022

Copy link
Copy Markdown
Contributor

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

There may be some misunderstanding, I am not asking how to read and set system properties. I want to know what "forceNioSocket" or "forceDomainSocket" does, and what documentation they are described in.

Obviously, they are not java standard system properties.

What I meant is that in NettyUtils we will have code to check for system properties and in that case, use only the "forced" class without checking other types for existence.

@czp3009

czp3009 commented Feb 14, 2022

Copy link
Copy Markdown
Contributor Author

I think a reasonable approach can be to control that with system properties like "forceNioSocket" or "forceDomainSocket" that will be set by specific tests.

hi @oshai , I'm sorry, but i couldn't find the description of system properties in the netty document, cloud you please provide the documentation page about that so I can learn it. Thanks!

I was referring java system properties: https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html

There may be some misunderstanding, I am not asking how to read and set system properties. I want to know what "forceNioSocket" or "forceDomainSocket" does, and what documentation they are described in.
Obviously, they are not java standard system properties.

What I meant is that in NettyUtils we will have code to check for system properties and in that case, use only the "forced" class without checking other types for existence.

Got it!

@oshai

oshai commented Oct 5, 2022

Copy link
Copy Markdown
Contributor

@czp3009 any update on this PR?

@czp3009

czp3009 commented Oct 6, 2022

Copy link
Copy Markdown
Contributor Author

@czp3009 any update on this PR?

I'm sorry, I'm still trying to update this PR, but I've been very busy at work and haven't been able to find the time. If I have time I will add the previously missing test code to this PR immediately

@oshai

oshai commented Oct 7, 2022

Copy link
Copy Markdown
Contributor

Add support for unix domain socket #175

Thanks! note that I continue work on that in #319.

@czp3009

czp3009 commented Oct 12, 2022

Copy link
Copy Markdown
Contributor Author

Thank you very much for your awesome work, since unix domain socket has been implemented, I will close the PR

@czp3009 czp3009 closed this Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants