Skip to content

'ConnectionManager::stopped_' never go to be 'true' in dubbo_proxy #17863

Closed

Description

@FeiYing9

Title: 'ConnectionManager::stopped_' never go to be 'true' in dubbo_proxy

Description:

I just try to understand how to write a private protocol network filter by reading the codes about the dubbo_proxy, now I'm confused about the variable of 'ConnectionManager::stopped_' which's value always be 'false'.
However, the same variable in thrift_proxy can be set to true at

Activity

  1. added
    triage
    on Aug 26, 2021
  2. wbpcode commented on Aug 26, 2021

    @wbpcode
    Member

    Yes. This stopped_ make on sense in the dubbo proxy. In the initial implementation of dubbo proxy, there is a lot of designs that refer to thrift proxy. I will try to remove it.

  3. wbpcode commented on Aug 26, 2021

    @wbpcode
    Member

    /assign

  4. FeiYing9 commented on Aug 26, 2021

    @FeiYing9
    Author

    Thanks @wbpcode . I have another question now:

    the method of Router::onStreamDecoded' implemented here:

    FilterStatus Router::onMessageDecoded(MessageMetadataSharedPtr metadata, ContextSharedPtr ctx) {

    and it's assigned here and then be applied:

    return filter->onMessageDecoded(metadata, ctx);


    That works fine in handling the requst traffic of dubbo.


    Then, I find the method of 'EncoderFilter::onStreamDecoded' is be assigned here and then be applied:

    return filter->onMessageEncoded(metadata, ctx);

    however, I cannot find where it's implemented? How can it works?

    It's really hard to understand the logic

  5. wbpcode commented on Aug 26, 2021

    @wbpcode
    Member

    Here created encoder filter action:

    parent_.encoder_filter_action_ = [metadata,
    ctx](DubboFilters::EncoderFilter* filter) -> FilterStatus {
    return filter->onMessageEncoded(metadata, ctx);
    };

    And here try to run the filters by the action:

    FilterStatus ActiveMessage::applyEncoderFilters(ActiveMessageEncoderFilter* filter,
    FilterIterationStartState state) {
    ASSERT(encoder_filter_action_ != nullptr);
    if (!local_response_sent_) {
    for (auto entry = commonEncodePrefix(filter, state); entry != encoder_filters_.end(); entry++) {
    const FilterStatus status = encoder_filter_action_((*entry)->handler().get());
    if (local_response_sent_) {
    break;
    }
    if (status != FilterStatus::Continue) {
    return status;
    }
    }
    }
    encoder_filter_action_ = nullptr;
    return FilterStatus::Continue;
    }

    If there is no any encoder filter, then the action will never run and do nothing.

    however, I cannot find where it's implemented? How can it works?

    So the answer is no where implement it. It just do nothing.

  6. wbpcode commented on Aug 26, 2021

    @wbpcode
    Member

    It's really hard to understand the logic

    Yes, its logic is indeed very complicated. Although we can simplify it later, the priority of this matter is not high.

  7. FeiYing9 commented on Aug 26, 2021

    @FeiYing9
    Author

    Yes, its logic is indeed very complicated. Although we can simplify it later, the priority of this matter is not high.

    Thanks a lot.

  8. added and removed
    triage
    on Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions