Skip to content

Commit

Permalink
Fix oppia#19271: Fix Docker Failures on macOS from Failed Syscalls (o…
Browse files Browse the repository at this point in the history
…ppia#19947)

* Fix Docker Failures on macOS from Failed Syscalls

On macOS, failed syscalls under Docker were not handled properly by
Python 2, which the Google Appengine development server runs under. Per
[PEP-0475](https://peps.python.org/pep-0475/), the correct response to a
failed syscall is to re-try the call, but this is not handled correctly
until Python 3. Therefore, in this commit we patch the Google Appengine
development server code to wrap the failing calls in try-except blocks.
This patching is performed each time the Docker containers start up.

For more details, see oppia#19271.

* Add wsgi_server.py to exclusion lists

* Add wsgi_server.py to linter ignore

* Fix path to Google CLoud SDK

* Tighten try-except conditions

* Prefix edited wsgi_server.py filename with patched_
  • Loading branch information
U8NWXD authored Mar 16, 2024
1 parent 13a2f6a commit e51de7e
Show file tree
Hide file tree
Showing 5 changed files with 616 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker/dev-server.entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ else
fi

$build_cmd
cp /app/oppia/docker/patched_wsgi_server.py /app/vm_deps/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py
$dev_appserver_cmd
Loading

0 comments on commit e51de7e

Please sign in to comment.