Skip to content

Commit

Permalink
downgrade uWSGI; wait for reset process to exit even on multi-server …
Browse files Browse the repository at this point in the history
…machines
  • Loading branch information
jhpyle committed Aug 20, 2024
1 parent 8660e1a commit f157730
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Change Log

## [1.5.4] - 2024-08-20

### Fixed
- Downgraded `uWSGI` due to issues with workers not being killed
promptly during the restart process.

## [1.5.3] - 2024-08-18

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions docassemble_base/docassemble/base/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,8 @@ def load(**kwargs):
daconfig['administrative interviews'] = new_admin_interviews
else:
del daconfig['administrative interviews']
if 'single server' in daconfig:
daconfig['single server'] = bool(daconfig['single server'])
if 'session lifetime seconds' in daconfig:
try:
daconfig['session lifetime seconds'] = int(daconfig['session lifetime seconds'])
Expand Down
9 changes: 5 additions & 4 deletions docassemble_webapp/docassemble/webapp/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ def update_editable():
NOTIFICATION_MESSAGE = daconfig.get('alert html', '<div class="da-alert alert alert-%s alert-dismissible fade show" role="alert">%s<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button></div>')

USING_SUPERVISOR = bool(os.environ.get('SUPERVISOR_SERVER_URL', None))
SINGLE_SERVER = USING_SUPERVISOR and bool(':all:' in ':' + os.environ.get('CONTAINERROLE', 'all') + ':')
SINGLE_SERVER = daconfig.get('single server', USING_SUPERVISOR and bool(':all:' in ':' + os.environ.get('CONTAINERROLE', 'all') + ':'))


audio_mimetype_table = {'mp3': 'audio/mpeg', 'ogg': 'audio/ogg'}

Expand Down Expand Up @@ -17069,7 +17070,7 @@ def update_package_ajax():
if isinstance(the_result, ReturnValue):
if the_result.ok:
# logmessage("update_package_ajax: success")
if (hasattr(the_result, 'restart') and not the_result.restart) or (START_TIME > session['serverstarttime'] and not (SINGLE_SERVER and reset_process_running())):
if (hasattr(the_result, 'restart') and not the_result.restart) or (START_TIME > session['serverstarttime'] and not reset_process_running()):
return jsonify(success=True, status='finished', ok=the_result.ok, summary=summarize_results(the_result.results, the_result.logmessages))
return jsonify(success=True, status='waiting')
if hasattr(the_result, 'error_message'):
Expand Down Expand Up @@ -29262,7 +29263,7 @@ def api_package_update_status():
the_result = result.get()
if isinstance(the_result, ReturnValue):
if the_result.ok:
if the_result.restart and (START_TIME <= task_info['server_start_time'] or (SINGLE_SERVER and reset_process_running())):
if the_result.restart and (START_TIME <= task_info['server_start_time'] or reset_process_running()):
return jsonify(status='working')
r.expire(the_key, 30)
return jsonify(status='completed', ok=True, log=summarize_results(the_result.results, the_result.logmessages, html=False))
Expand Down Expand Up @@ -29540,7 +29541,7 @@ def api_restart_status():
if task_data is None:
return jsonify(status='unknown')
task_info = json.loads(task_data.decode())
if START_TIME <= task_info['server_start_time'] or (SINGLE_SERVER and reset_process_running()):
if START_TIME <= task_info['server_start_time'] or reset_process_running():
return jsonify(status='working')
r.expire(the_key, 30)
return jsonify(status='completed')
Expand Down
2 changes: 1 addition & 1 deletion docassemble_webapp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def read(fname):
"urllib3==2.2.2",
"us==3.2.0",
"user-agents==2.2.0",
"uWSGI==2.0.25.1",
"uWSGI==2.0.23",
"vine==5.1.0",
"wcwidth==0.2.13",
"webdriver-manager==4.0.2",
Expand Down

0 comments on commit f157730

Please sign in to comment.