-
Notifications
You must be signed in to change notification settings - Fork 992
Include hot fixes in dev #3010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include hot fixes in dev #3010
Changes from all commits
e3de0d2
455b02a
c6b2cb5
f98b5db
8b1a939
f847358
1ffc551
ffec284
a653027
9500e73
32d9a8c
1393440
c6c86ed
def43f1
c6646ce
03196c5
46bf034
1d9583d
53c3c14
6954f9c
641f72f
d8f784a
7d58dae
e6940c6
e308fac
9a4b866
1e417ca
a1a9775
47a8c66
474c65c
ec6b295
3a075e0
c292154
04f6e32
022ac35
ec0e139
21fae40
9ca06bd
da84da9
4e8db78
6f5ef29
8da68d5
f5ff0f3
d536660
9da26ca
b282eec
6debf5f
e68adcc
b2707b9
6c039e3
9e93804
cbd0fd6
247b3bf
4ed1a26
cff1bdc
025192b
e00d172
53748c4
e67cf0c
65e08c9
94ebe3e
1b4b6cd
2b5981c
3ae2c20
7deb0f1
d8d40a2
a96b838
b475105
3a26e54
4dbc908
661f03e
64cc5e1
f4dad21
192f87d
73a4c6a
9792586
99c73c1
230925e
84ac28d
a234b9f
a414ab1
0b829bb
a71fde9
2000270
5e1fa51
ec1f374
f0b8def
8dcc0bf
648ce67
31ea276
3f9123c
c3b6e56
e6d93ff
3b542a4
2da45ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ | |
| import sqlalchemy as s | ||
|
|
||
| from keyman.KeyClient import KeyClient, KeyPublisher | ||
|
|
||
|
Check warning on line 33 in augur/application/cli/backend.py
|
||
| logger = AugurLogger("augur", reset_logfiles=True).get_logger() | ||
|
|
||
|
|
||
|
|
@@ -86,6 +86,9 @@ | |
|
|
||
| worker_vmem_cap = get_value("Celery", 'worker_process_vmem_cap') | ||
|
|
||
| # create rabbit messages so if it failed on shutdown the queues are clean | ||
| cleanup_collection_status_and_rabbit(logger, ctx.obj.engine) | ||
|
|
||
| gunicorn_command = f"gunicorn -c {gunicorn_location} -b {host}:{port} augur.api.server:app --log-file gunicorn.log" | ||
| server = subprocess.Popen(gunicorn_command.split(" ")) | ||
|
|
||
|
|
@@ -110,7 +113,7 @@ | |
| logger.info(f"The API is available at '{api_response.json()['route']}'") | ||
|
|
||
| processes = start_celery_worker_processes(float(worker_vmem_cap), disable_collection) | ||
|
|
||
|
Check warning on line 116 in augur/application/cli/backend.py
|
||
| if os.path.exists("celerybeat-schedule.db"): | ||
| logger.info("Deleting old task schedule") | ||
| os.remove("celerybeat-schedule.db") | ||
|
|
@@ -180,7 +183,7 @@ | |
|
|
||
| try: | ||
| keypub.shutdown() | ||
| cleanup_after_collection_halt(logger, ctx.obj.engine) | ||
| cleanup_collection_status_and_rabbit(logger, ctx.obj.engine) | ||
| except RedisConnectionError: | ||
| pass | ||
|
|
||
|
|
@@ -255,7 +258,7 @@ | |
| logger = logging.getLogger("augur.cli") | ||
|
|
||
| augur_stop(signal.SIGTERM, logger, ctx.obj.engine) | ||
|
|
||
|
Check warning on line 261 in augur/application/cli/backend.py
|
||
| @cli.command('stop-collection-blocking') | ||
| @test_connection | ||
| @test_db_connection | ||
|
|
@@ -268,7 +271,7 @@ | |
| processes = get_augur_processes() | ||
|
|
||
| stopped = [] | ||
|
|
||
|
Check warning on line 274 in augur/application/cli/backend.py
|
||
| p: psutil.Process | ||
| for p in processes: | ||
| if p.name() == "celery": | ||
|
|
@@ -278,7 +281,7 @@ | |
| if not len(stopped): | ||
| logger.info("No collection processes found") | ||
| return | ||
|
|
||
|
Check warning on line 284 in augur/application/cli/backend.py
|
||
| _, alive = psutil.wait_procs(stopped, 5, | ||
| lambda p: logger.info(f"STOPPED: {p.pid}")) | ||
|
|
||
|
|
@@ -287,7 +290,7 @@ | |
| for i in range(len(alive)): | ||
| if alive[i].status() == psutil.STATUS_ZOMBIE: | ||
| logger.info(f"KILLING ZOMBIE: {alive[i].pid}") | ||
| alive[i].kill() | ||
|
Check warning on line 293 in augur/application/cli/backend.py
|
||
| killed.append(i) | ||
| elif not alive[i].is_running(): | ||
| logger.info(f"STOPPED: {p.pid}") | ||
|
|
@@ -302,7 +305,7 @@ | |
| logger.info(f"Waiting on [{', '.join(str(p.pid for p in alive))}]") | ||
| time.sleep(0.5) | ||
|
|
||
| cleanup_after_collection_halt(logger, ctx.obj.engine) | ||
| cleanup_collection_status_and_rabbit(logger, ctx.obj.engine) | ||
|
|
||
| @cli.command('kill') | ||
| @test_connection | ||
|
|
@@ -316,11 +319,11 @@ | |
| logger = logging.getLogger("augur.cli") | ||
| augur_stop(signal.SIGKILL, logger, ctx.obj.engine) | ||
|
|
||
|
|
||
|
Check warning on line 322 in augur/application/cli/backend.py
|
||
| def augur_stop(signal, logger, engine): | ||
| """ | ||
| Stops augur with the given signal, | ||
| and cleans up collection if it was running | ||
|
Check warning on line 326 in augur/application/cli/backend.py
|
||
| """ | ||
|
|
||
| augur_processes = get_augur_processes() | ||
|
|
@@ -330,10 +333,10 @@ | |
| _broadcast_signal_to_processes(augur_processes, broadcast_signal=signal, given_logger=logger) | ||
|
|
||
| if "celery" in process_names: | ||
| cleanup_after_collection_halt(logger, engine) | ||
| cleanup_collection_status_and_rabbit(logger, engine) | ||
|
|
||
|
|
||
| def cleanup_after_collection_halt(logger, engine): | ||
| def cleanup_collection_status_and_rabbit(logger, engine): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [pylint] reported by reviewdog 🐶 |
||
| clear_redis_caches() | ||
|
|
||
| connection_string = get_value("RabbitMQ", "connection_string") | ||
|
sgoggins marked this conversation as resolved.
|
||
|
|
@@ -485,7 +488,7 @@ | |
| def _broadcast_signal_to_processes(processes, broadcast_signal=signal.SIGTERM, given_logger=None): | ||
| if given_logger is None: | ||
| _logger = logger | ||
| else: | ||
|
Check warning on line 491 in augur/application/cli/backend.py
|
||
| _logger = given_logger | ||
| for process in processes: | ||
| if process.pid != os.getpid(): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.