Skip to content

Commit

Permalink
[BACKPORT 2024.1][#22762] YSQL: Enable restarted webserver to serve r…
Browse files Browse the repository at this point in the history
…equests in MiniCluster tests.

Summary:
Original commit: 35a9a3f / D35456
5862233 / D35116 added cleanup logic to the webserver on calling Stop().
This was implemented, in part, by using an atomic bool `stop_initiated` to indicate that the webserver was shutting down.

This revision resets this variable on calling Start(). This flow is invoked exclusively in Minicluster tests involving webserver restarts.
In production environments, webserver restarts involve terminating the background worker running the webserver and starting a new one,
and so the problem of restarts does not exist in such environments.

Jira: DB-11665

Test Plan:
```
./yb_build.sh --cxx-test integration-tests_cql-backup-test --gtest_filter CqlBackupTest.TestBackupRestoreWithoutTSWebUI -n 12
```

Reviewers: telgersma, loginov

Reviewed By: telgersma

Subscribers: yql, smishra, ybase

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D35678
  • Loading branch information
karthik-ramanathan-3006 committed Jun 11, 2024
1 parent 41e4aae commit be6e0b0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/yb/server/webserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ Status Webserver::Impl::BuildListenSpec(string* spec) const {
Status Webserver::Impl::Start() {
LOG(INFO) << "Starting webserver on " << http_address_;

// Mini-cluster tests can restart the webserver by calling Stop() and Start() on the same instance
// of the webserver. To support this, reset the state that was set during the previous shutdown.
stop_initiated = false;

vector<const char*> options;

if (static_pages_available()) {
Expand Down

0 comments on commit be6e0b0

Please sign in to comment.