Push Database Finish Processing Tasks to context background process #51
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, when you have a large build that takes severals seconds to save to the database, the process can fail to save if the client uses the
--bes_upload_mode=fully_async
flagThis flag causes the client to send a graceful shutdown upon completion of transmission w/out waiting for an acknowledgment from the server. If the database process isn't done saving before this shutdown is received, the context is destroyed and the save fails (see below)
This also causes issues when the server tries to acknowledge requests
To address this, we can push the database save to a background process and let it finish in its own time, and we can ignore send errors when the client gracefully terminated the connection. (i think...? its not like we were doing anything but logging them anyway so....).