[ 
https://issues.apache.org/jira/browse/IGNITE-13098?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17173013#comment-17173013
 ] 

Ignite TC Bot commented on IGNITE-13098:
----------------------------------------

{panel:title=Branch: [pull/8057/head] Base: [master] : No blockers 
found!|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}{panel}
{panel:title=Branch: [pull/8057/head] Base: [master] : New Tests 
(8)|borderStyle=dashed|borderColor=#ccc|titleBGColor=#D6F7C1}
{color:#00008b}Service Grid{color} [[tests 
4|https://ci.ignite.apache.org/viewLog.html?buildId=5525471]]
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple 
[val1=DiscoveryEvent [evtNode=820e4b86-6df2-4d44-af89-6c97410dc97a, topVer=0, 
msgTemplate=null, span=null, nodeId8=d03dbb38, msg=, type=NODE_JOINED, 
tstamp=1596741683852], val2=AffinityTopologyVersion 
[topVer=8378924801797081360, minorTopVer=0]]] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple 
[val1=DiscoveryEvent [evtNode=820e4b86-6df2-4d44-af89-6c97410dc97a, topVer=0, 
msgTemplate=null, span=null, nodeId8=d03dbb38, msg=, type=NODE_JOINED, 
tstamp=1596741683852], val2=AffinityTopologyVersion 
[topVer=8378924801797081360, minorTopVer=0]]] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple 
[val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest 
[id=09a8835c371-4c0998e2-b4ac-448a-a292-806b69b72e7f, reqs=SingletonList 
[ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent 
[evtNode=4d31c3b8-b825-447a-9ada-1f616602d659, topVer=0, msgTemplate=null, 
span=null, nodeId8=4d31c3b8, msg=null, type=DISCOVERY_CUSTOM_EVT, 
tstamp=1596741683852]], val2=AffinityTopologyVersion 
[topVer=3600646592563058421, minorTopVer=0]]] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple 
[val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest 
[id=09a8835c371-4c0998e2-b4ac-448a-a292-806b69b72e7f, reqs=SingletonList 
[ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent 
[evtNode=4d31c3b8-b825-447a-9ada-1f616602d659, topVer=0, msgTemplate=null, 
span=null, nodeId8=4d31c3b8, msg=null, type=DISCOVERY_CUSTOM_EVT, 
tstamp=1596741683852]], val2=AffinityTopologyVersion 
[topVer=3600646592563058421, minorTopVer=0]]] - PASSED{color}

{color:#00008b}Service Grid (legacy mode){color} [[tests 
4|https://ci.ignite.apache.org/viewLog.html?buildId=5525472]]
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple 
[val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest 
[id=26cf835c371-7d8273ec-cef4-4d2a-866e-dec71312fb9a, reqs=SingletonList 
[ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent 
[evtNode=eea2b362-d4eb-4b61-960f-df75b3109e20, topVer=0, msgTemplate=null, 
span=null, nodeId8=eea2b362, msg=null, type=DISCOVERY_CUSTOM_EVT, 
tstamp=1596741712990]], val2=AffinityTopologyVersion 
[topVer=3717633026555016160, minorTopVer=0]]] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple 
[val1=DiscoveryEvent [evtNode=f621a928-34cd-4adb-b5dc-3d99c22ceb5b, topVer=0, 
msgTemplate=null, span=null, nodeId8=cd5d6b7f, msg=, type=NODE_JOINED, 
tstamp=1596741712990], val2=AffinityTopologyVersion 
[topVer=-172409504567755083, minorTopVer=0]]] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.requestId[Test event=IgniteBiTuple 
[val1=DiscoveryEvent [evtNode=f621a928-34cd-4adb-b5dc-3d99c22ceb5b, topVer=0, 
msgTemplate=null, span=null, nodeId8=cd5d6b7f, msg=, type=NODE_JOINED, 
tstamp=1596741712990], val2=AffinityTopologyVersion 
[topVer=-172409504567755083, minorTopVer=0]]] - PASSED{color}
* {color:#013220}IgniteServiceGridTestSuite: 
ServiceDeploymentProcessIdSelfTest.topologyVersion[Test event=IgniteBiTuple 
[val1=DiscoveryCustomEvent [customMsg=ServiceChangeBatchRequest 
[id=26cf835c371-7d8273ec-cef4-4d2a-866e-dec71312fb9a, reqs=SingletonList 
[ServiceUndeploymentRequest []]], affTopVer=null, super=DiscoveryEvent 
[evtNode=eea2b362-d4eb-4b61-960f-df75b3109e20, topVer=0, msgTemplate=null, 
span=null, nodeId8=eea2b362, msg=null, type=DISCOVERY_CUSTOM_EVT, 
tstamp=1596741712990]], val2=AffinityTopologyVersion 
[topVer=3717633026555016160, minorTopVer=0]]] - PASSED{color}

{panel}
[TeamCity *--> Run :: All* 
Results|https://ci.ignite.apache.org/viewLog.html?buildId=5525494&buildTypeId=IgniteTests24Java8_RunAll]

> TcpCommunicationSpi split to independent classes
> ------------------------------------------------
>
>                 Key: IGNITE-13098
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13098
>             Project: Ignite
>          Issue Type: Bug
>         Environment: TcpCommunicationSpi split to independent classes
>            Reporter: Stepachev Maksim
>            Assignee: Stepachev Maksim
>            Priority: Major
>             Fix For: 2.10
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h2. Description
> This ticket describes  requirements for TcpCommunicationSpi refactoring. The 
> main goal is to split the class without changing behavior and public API.
> *Actual problem:*
> CurrentlyTcpCommunicationSpi has over 5K lines and includes about15+ inner 
> classes like:
>  # ShmemAcceptWorker
>  # SHMemHandshakeClosure
>  # ShmemWorker
>  # CommunicationDiscoveryEventListener
>  # CommunicationWorker
>  # ConnectFuture
>  # ConnectGateway
>  # ConnectionKey
>  # ConnectionPolicy
>  # DisconnectedSessionInfo
>  # FirstConnectionPolicy
>  # HandshakeTimeoutObject
>  # RoundRobinConnectionPolicy
>  # TcpCommunicationConnectionCheckFuture
>  # TcpCommunicationSpiMBeanImpl
> In addition, it contains logic of client connection life cycle, nio server 
> handler, and handshake handler.
> The classes above have cyclic dependencies and high coupling.The whole 
> mechanism works because classes have access to each other via parent class 
> references. As a result, initialization of class isn't consistent. By 
> consistent I mean that class created via constructor is ready to be used. All 
> of the classes work with context and shareproperties everywhere.
> Many methods of TcpCommunicationSpi don’t have a single responsibility. 
> Example is getNodeAttribute:,it makes client reservation,  takes the IP 
> address of the node and provides attributes.
> It works fine and we usually don’t have reasons to change anything. But if 
> you want to create a test that has a little different behavior than a 
> blocking message, you can't mock or change the behavior of inner classes. For 
> example, test covering change in the handshake process. Some people make test 
> methods in public API like "closeConnections" or "openSocketChannel" because 
> the current design isn't fine for it. It also takes a lot of time for test 
> development for minor changes.
> *Solution:*
> The scope of work is big and communication spi is place which should be 
> changed carefully. I recommend to make this refactoring step by step.
>  * The first idea is to split the parent class into independent classes and 
> move them to the internal package. We should achieveSOLID when it’s done.
>  * Extract spread logic to appropriate classes like ClientPool, 
> HandshakeHandler, etc.
>  * Make a common transfer object for TCSpi configuration.
>  * Make dependencies direct if it is possible.
>  * Initialize all dependencies in one place.
>  * Make child classes context-free.
>  * Try to do classes more testable.
>  * Use the idea of dependency injection without a framework for it.
> *Benefits:*
> With the ability to write truly jUnit-style tests and cover functionality 
> with better testing we get a way to easier develop new features and 
> optimizations needed in such low-level components as TcpCommunicationSpi.
> Examples of features that improve usability of Apache Ignite a lot are: 
> inverse communication connection with optimizations and connection 
> multiplexing. Both of the features could be used in environments with 
> restricted network connectivity (e.g. when connections between nodes could be 
> established only in one direction).



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to