10000 support user processor with life cycle interface fix #123 by cytnju · Pull Request #200 · sofastack/sofa-bolt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

support user processor with life cycle interface fix #123 #200

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

cytnju
Copy link
Contributor
@cytnju cytnju commented Dec 4, 2019

#123
support user processor with life cycle.

public class SimpleUserProcessor implements UserProcessor {
    ...
         public void startup() {
         // do startup
         } 

         public void shutdown() {
        // do shutdown
         } 
}

Both RpcClient and RpcServer will startup all the userProcessor when startup and shutdown all the userProcessor when shutdown.

public void startup() throws LifeCycleException {
        super.startup();

        for (UserProcessor<?> userProcessor : userProcessors.values()) {
            userProcessor.startup();
        }
        // startup other components
        ... 
    }
public void shutdown() {
        super.shutdown();
     
        // shutdown other components
        ... 

        for (UserProcessor<?> userProcessor : userProcessors.values()) {
            userProcessor.shutdown();
        }
}

@sofastack-bot sofastack-bot bot added bug Something isn't working cla:yes size/M labels Dec 4, 2019
@dbl-x dbl-x added this to the 1.6.1 release milestone Dec 6, 2019
@dbl-x
Copy link
Contributor
dbl-x commented Dec 6, 2019

@cytnju processor增加了生命周期之后,registerUserProcessor方法是不是要生命周期的检测。是否存在场景,我先start rpcclient,之后register,这个时候就没有调用processor的生命周期了。

@cytnju
Copy link
Contributor Author
cytnju commented Dec 6, 2019

@cytnju processor增加了生命周期之后,registerUserProcessor方法是不是要生命周期的检测。是否存在场景,我先start rpcclient,之后register,这个时候就没有调用processor的生命周期了。

确实会有这个问题,我做一个校验吧,如果在启动后注册,那就直接在注册时将processor启动起来。

@cytnju cytnju requested a review from dbl-x December 6, 2019 09:18
@dbl-x
Copy link
Contributor
dbl-x commented Dec 12, 2019

@cytnju processor增加了生命周期之后,registerUserProcessor方法是不是要生命周期的检测。是否存在场景,我先start rpcclient,之后register,这个时候就没有调用processor的生命周期了。

确实会有这个问题,我做一个校验吧,如果在启动后注册,那就直接在注册时将processor启动起来。

如果processor已经start,就不能再start了吧;包括shutdown的时候也要校验状态吧?
看变更是没有校验,直接client启动的时候所有processor启动了一遍;关闭的时候所有的关闭了一遍。

@cytnju cytnju force-pushed the feature/user_processor_support_life_cycle branch from 6b28105 to 3bb16ca Compare December 12, 2019 13:38
@dbl-x dbl-x merged commit 862ac48 into sofastack:dev_1.6.1 Dec 12, 2019
dbl-x pushed a commit that referenced this pull request Dec 16, 2019
* (feat) add flush consolidation handler (#161)

* (feat) add flush consolidation option

* 1. upgrade version to 1.5.6 (#169)

2. fix NPE in channelInactive
3. handling reconnection situation with no connection binding with channel
4. du not scan connection pool associated with task that has not been don
5. add CONNECT_FAILED event type and print user event log

* Change org from alipay to sofatack. (#172)

* Update .travis.yml (#177)

* modify ReconnectManager to be compatible with version 1.5.x

* upgrade netty version to fix CNNVD-201909-1264 vulnerability (#189)

* 应该一个是序列化一个是反序列化 (#191)

fix unit test bug in class NormalStringCustomSerializer.

* (feat) Supports SSL for rpc server/client, #149 (#197)

* support server random port constructor. fix #196 (#199)

* fix AbstractLifeCycle concurrency problem Fixes gh-163 (#188)

* fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157

* Revert "fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157"

This reverts commit 2784f9e.

* support server random port constructor

* add rejection-processable InvokeCallback to provide flexible options when user executor rejected task. see #178(#178) (#202)

* complete tcp related config. see #171(#171) (#205)

* optimize DefaultConnectionManager contructor (#201)

* support availability check with life cycle. #195 (#204)

* support availability check with life cycle. #123(#123)

* complete unit test of life cycle available check

* fix CI error

* Fix/multi processor bug (#207)

* fix spell mistake and some test codes (#194)

* fix multi-processor bug

* fix PMD

* support user processor with life cycle interface fix #123 (#200)

* support user processor with life cycle interface

* make sure user processor startup if client/server has startup

* add state check before operate user processor in order to prevent from some unnecessary exception

* fix some codes (#208)

* change version
@dbl-x dbl-x mentioned this pull request Jul 6, 2020
cytnju added a commit that referenced this pull request Jul 6, 2020
* release 1.6.1 (#209)

* (feat) add flush consolidation handler (#161)

* (feat) add flush consolidation option

* 1. upgrade version to 1.5.6 (#169)

2. fix NPE in channelInactive
3. handling reconnection situation with no connection binding with channel
4. du not scan connection pool associated with task that has not been don
5. add CONNECT_FAILED event type and print user event log

* Change org from alipay to sofatack. (#172)

* Update .travis.yml (#177)

* modify ReconnectManager to be compatible with version 1.5.x

* upgrade netty version to fix CNNVD-201909-1264 vulnerability (#189)

* 应该一个是序列化一个是反序列化 (#191)

fix unit test bug in class NormalStringCustomSerializer.

* (feat) Supports SSL for rpc server/client, #149 (#197)

* support server random port constructor. fix #196 (#199)

* fix AbstractLifeCycle concurrency problem Fixes gh-163 (#188)

* fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157

* Revert "fix  AsynMultiInterestUserProcessor dispatch to sync handleRequest  method problem. gh-157"

This reverts commit 2784f9e.

* support server random port constructor

* add rejection-processable InvokeCallback to provide flexible options when user executor rejected task. see #178(#178) (#202)

* complete tcp related config. see #171(#171) (#205)

* optimize DefaultConnectionManager contructor (#201)

* support availability check with life cycle. #195 (#204)

* support availability check with life cycle. #123(#123)

* complete unit test of life cycle available check

* fix CI error

* Fix/multi processor bug (#207)

* fix spell mistake and some test codes (#194)

* fix multi-processor bug

* fix PMD

* support user processor with life cycle interface fix #123 (#200)

* support user processor with life cycle interface

* make sure user processor startup if client/server has startup

* add state check before operate user processor in order to prevent from some unnecessary exception

* fix some codes (#208)

* change version

* update travis ci config

Co-authored-by: cytnju <muyun.cyt@antfin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cla:yes size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0