This repository was archived by the owner on Oct 2, 2025. It is now read-only.
Use separate error buffers for different processes in gprestore helper#87
Merged
Use separate error buffers for different processes in gprestore helper#87
Conversation
Problem description: gprestore helper reused one error buffer for multiple processes when it worked with a plugin. It resulted in the following problem: if the plugin was launched several times, the error was detected only on the 2nd run, while the error happens on each plugin run. Fix: Add a separate error buffer for each RestoreReader. For the backup helper case, keep one error buffer as only one backup plugin instance is started for each backup helper (but now the buffer is made local in doBackupAgent).
bimboterminator1
approved these changes
May 29, 2024
dnskvlnk
approved these changes
Jun 3, 2024
RekGRpth
pushed a commit
that referenced
this pull request
Aug 1, 2024
#87) Problem description: gprestore helper reused one error buffer for stderr of multiple processes when it worked with a plugin. It resulted in the following problem: if the plugin was launched several times, the error could be detected only on the 2nd run, while the error happens (i.e. plugin outputs something to the stderr) on each plugin run. Fix: Add a separate error buffer for each RestoreReader. As now there is no need for global 'errBuf' variable, it was moved to 'doBackupAgent' as a local variable (keeping it global without obvious need is a bad practice). For the backup helper case, it is ok to have only one buffer as only one backup plugin instance is started for each backup helper. Tests are not added because the problem has no stable reproduction scenario - it depends on the timing of writing to the stderr. (cherry picked from commit ab19bff)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Use separate error buffers for different processes in gprestore helper
Problem description:
gprestore helper reused one error buffer for stderr of multiple processes when
it worked with a plugin. It resulted in the following problem: if the plugin was
launched several times, the error could be detected only on the 2nd run, while
the error happens (i.e. plugin outputs something to the stderr) on each plugin
run.
Fix:
Add a separate error buffer for each RestoreReader.
As now there is no need for global 'errBuf' variable, it was moved to
'doBackupAgent' as a local variable (keeping it global without obvious need is a
bad practice). For the backup helper case, it is ok to have only one buffer as
only one backup plugin instance is started for each backup helper.
Tests are not added because the problem has no stable reproduction scenario - it
depends on the timing of writing to the stderr.