While helper reading code does check for COMM_ERR_CLOSING, it is not sufficient
because helperReturnBuffer() called by the reading code may notice the helper
shutdown flag (set earlier by reconfigure) and start closing the connection
underneath the reading code feet.
#include "comm/Connection.h"
#include "comm/Write.h"
#include "fd.h"
+#include "fde.h"
#include "format/Quoting.h"
#include "helper.h"
#include "Mem.h"
srv->rbuf[srv->roffset] = '\0';
}
- if (Comm::IsConnOpen(srv->readPipe)) {
+ if (Comm::IsConnOpen(srv->readPipe) && !fd_table[srv->readPipe->fd].closing()) {
int spaceSize = srv->rbuf_sz - srv->roffset - 1;
assert(spaceSize >= 0);
helperStatefulReleaseServer(srv);
}
- if (Comm::IsConnOpen(srv->readPipe)) {
+ if (Comm::IsConnOpen(srv->readPipe) && !fd_table[srv->readPipe->fd].closing()) {
int spaceSize = srv->rbuf_sz - srv->roffset - 1;
assert(spaceSize >= 0);