Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions proxy/http/HttpProxyServerMain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ std::mutex proxyServerMutex;
std::condition_variable proxyServerCheck;
bool et_net_threads_ready = false;

std::mutex etUdpMutex;
std::condition_variable etUdpCheck;
bool et_udp_threads_ready = false;

extern int num_of_net_threads;
extern int num_accept_threads;

Expand Down Expand Up @@ -322,6 +326,15 @@ init_HttpProxyServer()
lock.unlock();
proxyServerCheck.notify_one();
}

#if TS_USE_QUIC == 1
if (eventProcessor.has_tg_started(ET_UDP)) {
std::unique_lock<std::mutex> lock(etUdpMutex);
et_udp_threads_ready = true;
lock.unlock();
etUdpCheck.notify_one();
}
#endif
}

void
Expand Down
4 changes: 4 additions & 0 deletions proxy/http/HttpProxyServerMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ NetProcessor::AcceptOptions make_net_accept_options(const HttpProxyPort *port, u
extern std::mutex proxyServerMutex;
extern std::condition_variable proxyServerCheck;
extern bool et_net_threads_ready;

extern std::mutex etUdpMutex;
extern std::condition_variable etUdpCheck;
extern bool et_udp_threads_ready;
7 changes: 7 additions & 0 deletions src/traffic_server/traffic_server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2098,6 +2098,7 @@ main(int /* argc ATS_UNUSED */, const char **argv)
}
if (num_of_udp_threads) {
udpNet.start(num_of_udp_threads, stacksize);
eventProcessor.thread_group[ET_UDP]._afterStartCallback = init_HttpProxyServer;
}

// Initialize Response Body Factory
Expand Down Expand Up @@ -2135,6 +2136,12 @@ main(int /* argc ATS_UNUSED */, const char **argv)
proxyServerCheck.wait(lock, [] { return et_net_threads_ready; });
}

#if TS_USE_QUIC == 1
if (num_of_udp_threads) {
std::unique_lock<std::mutex> lock(etUdpMutex);
etUdpCheck.wait(lock, [] { return et_udp_threads_ready; });
}
#endif
// Delay only if config value set and flag value is zero
// (-1 => cache already initialized)
if (delay_p && ink_atomic_cas(&delay_listen_for_cache, 0, 1)) {
Expand Down