forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hot_restarting_child.h
34 lines (28 loc) · 1.08 KB
/
hot_restarting_child.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#pragma once
#include "source/common/stats/stat_merger.h"
#include "source/server/hot_restarting_base.h"
namespace Envoy {
namespace Server {
/**
* The child half of hot restarting. Issues requests and commands to the parent.
*/
class HotRestartingChild : HotRestartingBase {
public:
HotRestartingChild(int base_id, int restart_epoch, const std::string& socket_path,
mode_t socket_mode);
int duplicateParentListenSocket(const std::string& address, uint32_t worker_index);
std::unique_ptr<envoy::HotRestartMessage> getParentStats();
void drainParentListeners();
absl::optional<HotRestart::AdminShutdownResponse> sendParentAdminShutdownRequest();
void sendParentTerminateRequest();
void mergeParentStats(Stats::Store& stats_store,
const envoy::HotRestartMessage::Reply::Stats& stats_proto);
private:
const int restart_epoch_;
bool parent_terminated_{};
sockaddr_un parent_address_;
std::unique_ptr<Stats::StatMerger> stat_merger_{};
Stats::StatName hot_restart_generation_stat_name_;
};
} // namespace Server
} // namespace Envoy