Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: don't resend message if it is rejected by server (XiaoMi#722)
Browse files Browse the repository at this point in the history
levy5307 authored and zhangyifan27 committed Jan 14, 2021

Verified

This commit was signed with the committer’s verified signature.
maksim-paskal Maksim Paskal
1 parent 6666355 commit 7a14883
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/client/partition_resolver.cpp
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ void partition_resolver::call_task(const rpc_response_task_ptr &t)
dsn::error_code err, dsn::message_ex * req, dsn::message_ex * resp)
{
if (req->header->gpid.value() != 0 && err != ERR_OK && err != ERR_HANDLER_NOT_FOUND &&
err != ERR_APP_NOT_EXIST && err != ERR_OPERATION_DISABLED) {
err != ERR_APP_NOT_EXIST && err != ERR_OPERATION_DISABLED && err != ERR_BUSY) {
on_access_failure(req->header->gpid.get_partition_index(), err);
// still got time, retry
uint64_t nms = dsn_now_ms();
8 changes: 4 additions & 4 deletions src/common/duplication_common.cpp
Original file line number Diff line number Diff line change
@@ -30,9 +30,11 @@
#include <dsn/utility/singleton.h>
#include <dsn/utils/time_utils.h>
#include <nlohmann/json.hpp>
#include <dsn/utility/flags.h>

namespace dsn {
namespace replication {
DSN_DEFINE_string("replication", cluster_name, "", "name of this cluster");

/*extern*/ const char *duplication_status_to_string(duplication_status::type status)
{
@@ -54,10 +56,8 @@ namespace replication {

/*extern*/ const char *get_current_cluster_name()
{
static const char *cluster_name =
dsn_config_get_value_string("replication", "cluster_name", "", "name of this cluster");
dassert(strlen(cluster_name) != 0, "cluster_name is not set");
return cluster_name;
dassert(strlen(FLAGS_cluster_name) != 0, "cluster_name is not set");
return FLAGS_cluster_name;
}

namespace internal {

0 comments on commit 7a14883

Please sign in to comment.