[squid-dev] Jenkins build is back to normal : 5-matrix » gcc,d-fedora-21 #64

2017-01-11 Thread noc
https://build.squid-cache.org/job/5-matrix/compiler=gcc,label=d-fedora-21/64/
___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


[squid-dev] Jenkins build is back to normal : 5-matrix » clang,d-fedora-23 #64

2017-01-11 Thread noc
https://build.squid-cache.org/job/5-matrix/compiler=clang,label=d-fedora-23/64/
___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


[squid-dev] Jenkins build is back to normal : 5-matrix » clang,d-fedora-22 #64

2017-01-11 Thread noc
https://build.squid-cache.org/job/5-matrix/compiler=clang,label=d-fedora-22/64/
___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


[squid-dev] Build failed in Jenkins: 5-matrix » clang,d-fedora-22 #63

2017-01-11 Thread noc
https://build.squid-cache.org/job/5-matrix/compiler=clang,label=d-fedora-22/63/--
[...truncated 3.78 MB...]
libtool: compile:  ccache clang++ -DHAVE_CONFIG_H -I../../../.. 
-I../../../../include -I../../../../lib -I../../../../src -I../../include 
-I/usr/include/libxml2 -I/usr/include/libxml2 -Werror -Qunused-arguments 
-Wno-deprecated-register -D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 
-std=c++11 -MT Eui64.lo -MD -MP -MF .deps/Eui64.Tpo -c 
../../../../src/acl/Eui64.cc  -fPIC -DPIC -o .libs/Eui64.o
libtool: compile:  ccache clang++ -DHAVE_CONFIG_H -I../../../.. 
-I../../../../include -I../../../../lib -I../../../../src -I../../include 
-I/usr/include/libxml2 -I/usr/include/libxml2 -Werror -Qunused-arguments 
-Wno-deprecated-register -D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 
-std=c++11 -MT AdaptationService.lo -MD -MP -MF .deps/AdaptationService.Tpo -c 
../../../../src/acl/AdaptationService.cc  -fPIC -DPIC -o AdaptationService.o 
>/dev/null 2>&1
/bin/sh ../../libtool  --tag=CXX   --mode=link ccache clang++ 
-I/usr/include/libxml2  -Werror -Qunused-arguments -Wno-deprecated-register  
-D_REENTRANT -I/usr/include/p11-kit-1  -g -O2 -std=c++11  -g -o libapi.la  
Acl.lo BoolOps.lo Checklist.lo InnerNode.lo Tree.lo  
libtool: compile:  ccache clang++ -DHAVE_CONFIG_H -I../../../.. 
-I../../../../include -I../../../../lib -I../../../../src -I../../include 
-I/usr/include/libxml2 -I/usr/include/libxml2 -Werror -Qunused-arguments 
-Wno-deprecated-register -D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 
-std=c++11 -MT AdaptationServiceData.lo -MD -MP -MF 
.deps/AdaptationServiceData.Tpo -c ../../../../src/acl/AdaptationServiceData.cc 
 -fPIC -DPIC -o AdaptationServiceData.o >/dev/null 2>&1
/bin/sh ../../libtool  --tag=CXX   --mode=link ccache clang++ 
-I/usr/include/libxml2  -Werror -Qunused-arguments -Wno-deprecated-register  
-D_REENTRANT -I/usr/include/p11-kit-1  -g -O2 -std=c++11  -g -o libstate.la  
Strategised.lo FilledChecklist.lo Address.lo  
libtool: link: /usr/bin/ar cru .libs/libapi.a .libs/Acl.o .libs/BoolOps.o 
.libs/Checklist.o .libs/InnerNode.o .libs/Tree.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libapi.a
libtool: link: ( cd ".libs" && rm -f "libapi.la" && ln -s "../libapi.la" 
"libapi.la" )
libtool: link: /usr/bin/ar cru .libs/libstate.a .libs/Strategised.o 
.libs/FilledChecklist.o .libs/Address.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libstate.a
libtool: link: ( cd ".libs" && rm -f "libstate.la" && ln -s "../libstate.la" 
"libstate.la" )
libtool: compile:  ccache clang++ -DHAVE_CONFIG_H -I../../../.. 
-I../../../../include -I../../../../lib -I../../../../src -I../../include 
-I/usr/include/libxml2 -I/usr/include/libxml2 -Werror -Qunused-arguments 
-Wno-deprecated-register -D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 
-std=c++11 -MT Arp.lo -MD -MP -MF .deps/Arp.Tpo -c ../../../../src/acl/Arp.cc  
-fPIC -DPIC -o Arp.o >/dev/null 2>&1
libtool: compile:  ccache clang++ -DHAVE_CONFIG_H -I../../../.. 
-I../../../../include -I../../../../lib -I../../../../src -I../../include 
-I/usr/include/libxml2 -I/usr/include/libxml2 -Werror -Qunused-arguments 
-Wno-deprecated-register -D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 
-std=c++11 -MT Eui64.lo -MD -MP -MF .deps/Eui64.Tpo -c 
../../../../src/acl/Eui64.cc  -fPIC -DPIC -o Eui64.o >/dev/null 2>&1
/bin/sh ../../libtool  --tag=CXX   --mode=link ccache clang++ 
-I/usr/include/libxml2  -Werror -Qunused-arguments -Wno-deprecated-register  
-D_REENTRANT -I/usr/include/p11-kit-1  -g -O2 -std=c++11  -g -o libacls.la  
IntRange.lo RegexData.lo StringData.lo Time.lo TimeData.lo AllOf.lo AnyOf.lo 
Asn.lo Browser.lo ConnectionsEncrypted.lo DestinationDomain.lo DestinationIp.lo 
DomainData.lo ExtUser.lo HierCodeData.lo HierCode.lo HttpHeaderData.lo 
HttpRepHeader.lo HttpReqHeader.lo HttpStatus.lo Ip.lo LocalIp.lo LocalPort.lo 
MaxConnection.lo Method.lo MethodData.lo MyPortName.lo Note.lo NoteData.lo 
PeerName.lo Protocol.lo ProtocolData.lo Random.lo Referer.lo ReplyMimeType.lo 
RequestMimeType.lo SourceDomain.lo SourceIp.lo SquidError.lo SquidErrorData.lo 
Tag.lo Url.lo UrlLogin.lo UrlPath.lo UrlPort.lo UserData.lo Gadgets.lo 
AclSizeLimit.lo AtStep.lo AtStepData.lo CertificateData.lo Certificate.lo 
ServerCertificate.lo ServerName.lo SslError.lo SslErrorData.lo 
AdaptationService.lo AdaptationServiceData.lo Arp.lo Eui64.lo  
libtool: link: /usr/bin/ar cru .libs/libacls.a .libs/IntRange.o 
.libs/RegexData.o .libs/StringData.o .libs/Time.o .libs/TimeData.o 
.libs/AllOf.o .libs/AnyOf.o .libs/Asn.o .libs/Browser.o 
.libs/ConnectionsEncrypted.o .libs/DestinationDomain.o .libs/DestinationIp.o 
.libs/DomainData.o .libs/ExtUser.o .libs/HierCodeData.o .libs/HierCode.o 
.libs/HttpHeaderData.o .libs/HttpRepHeader.o .libs/HttpReqHeader.o 
.libs/HttpStatus.o .libs/Ip.o .libs/LocalIp.o .libs/LocalPort.o 
.libs/MaxConnection.o 

[squid-dev] Build failed in Jenkins: 5-matrix » gcc,d-fedora-21 #63

2017-01-11 Thread noc
https://build.squid-cache.org/job/5-matrix/compiler=gcc,label=d-fedora-21/63/--
[...truncated 5.48 MB...]
cd ../.. && make  am--refresh
make[4]: Entering directory 
'
make[4]: *** No rule to make target 'am--refresh'.  Stop.
make[4]: Leaving directory 
'
Makefile:798: recipe for target '../../config.status' failed
make[3]: *** [../../config.status] Error 2
make[3]: Leaving directory 
'
Makefile:6945: recipe for target 'uninstall-recursive' failed
make[2]: *** [uninstall-recursive] Error 1
make[2]: Leaving directory 
'
Makefile:570: recipe for target 'uninstall-recursive' failed
make[1]: *** [uninstall-recursive] Error 1
make[1]: Leaving directory 
'
Makefile:778: recipe for target 'distcheck' failed
make: *** [distcheck] Error 1
buildtest.sh result is 2
BUILD: .././test-suite/buildtests/layer-02-maximus.opts
configure: BUILD LIBRARIES: 
configure: BUILD EXTRA LIBRARIES: -ldl -lm -lnsl -lresolv -lcap -lrt -ldl -ldl
configure: BUILD OBJECTS: 
configure: BUILD EXTRA OBJECTS: 
configure: BUILD C FLAGS: -Wall -g -O2
configure: BUILD EXTRA C FLAGS: -Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow -Werror -pipe 
-D_REENTRANT
configure: BUILD C++ FLAGS:  -I/usr/include/p11-kit-1  -g -O2 -std=c++11
configure: BUILD EXTRA C++ FLAGS: -I/usr/include/libxml2 -Wall -Wpointer-arith 
-Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -Werror 
-Wno-deprecated-register -pipe -D_REENTRANT
configure: BUILD Tools C++ FLAGS:   -I/usr/include/p11-kit-1  -g -O2 -std=c++11
configure: BUILD LIBRARIES: 
configure: BUILD EXTRA LIBRARIES: -ldl -lm -lnsl -lresolv -lcap -lrt -ldl -ldl
configure: BUILD OBJECTS: 
configure: BUILD EXTRA OBJECTS: 
configure: BUILD C FLAGS: -Wall -g -O2
configure: BUILD EXTRA C FLAGS: -Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow -Werror -pipe 
-D_REENTRANT
configure: BUILD C++ FLAGS:  -I/usr/include/p11-kit-1  -g -O2 -std=c++11
configure: BUILD EXTRA C++ FLAGS: -I/usr/include/libxml2 -Wall -Wpointer-arith 
-Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual -Werror 
-Wno-deprecated-register -pipe -D_REENTRANT
configure: BUILD Tools C++ FLAGS:   -I/usr/include/p11-kit-1  -g -O2 -std=c++11
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
# XFAIL: 0
# FAIL:  0
2017/01/11 20:13:20| FATAL: MIME Config Table 
:
 (2) No such file or directory
2017/01/11 

[squid-dev] Build failed in Jenkins: 5-matrix » clang,d-fedora-23 #63

2017-01-11 Thread noc
https://build.squid-cache.org/job/5-matrix/compiler=clang,label=d-fedora-23/63/--
[...truncated 219.06 KB...]
checking linux/types.h usability... yes
checking linux/types.h presence... yes
checking for linux/types.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking memory.h usability... yes
checking memory.h presence... yes
checking for memory.h... yes
checking mount.h usability... no
checking mount.h presence... no
checking for mount.h... no
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/in_systm.h usability... yes
checking netinet/in_systm.h presence... yes
checking for netinet/in_systm.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking paths.h usability... yes
checking paths.h presence... yes
checking for paths.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking for pwd.h... (cached) yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking siginfo.h usability... no
checking siginfo.h presence... no
checking for siginfo.h... no
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking stdlib.h usability... yes
checking stdlib.h presence... yes
checking for stdlib.h... yes
checking string.h usability... yes
checking string.h presence... yes
checking for string.h... yes
checking strings.h usability... yes
checking strings.h presence... yes
checking for strings.h... yes
checking sys/bitypes.h usability... yes
checking sys/bitypes.h presence... yes
checking for sys/bitypes.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/ipc.cc usability... no
checking sys/ipc.cc presence... no
checking for sys/ipc.cc... no
checking for sys/param.h... (cached) yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking sys/md5.h usability... no
checking sys/md5.h presence... no
checking for sys/md5.h... no
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/msg.h usability... yes
checking sys/msg.h presence... yes
checking for sys/msg.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking for sys/socket.h... (cached) yes
checking sys/stat.h usability... yes
checking sys/stat.h presence... yes
checking for sys/stat.h... yes
checking syscall.h usability... yes
checking syscall.h presence... yes
checking for syscall.h... yes
checking sys/syscall.h usability... yes
checking sys/syscall.h presence... yes
checking for sys/syscall.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for sys/types.h... (cached) yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking sys/vfs.h usability... yes
checking sys/vfs.h presence... yes
checking for sys/vfs.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking time.h usability... yes
checking time.h presence... yes
checking for time.h... yes
checking for unistd.h... (cached) yes
checking utime.h usability... yes
checking utime.h presence... yes
checking for utime.h... yes
checking varargs.h usability... no
checking varargs.h presence... no
checking for varargs.h... no
checking byteswap.h usability... yes
checking byteswap.h presence... yes
checking for byteswap.h... yes
checking glib.h usability... no
checking glib.h presence... no
checking for 

Re: [squid-dev] [PATCH] remove USE_CHUNKEDMEMPOOLS

2017-01-11 Thread Kinkie
Please go ahead when it's convenient for you.

On Wed, Jan 11, 2017 at 4:00 PM, Amos Jeffries  wrote:
> On 12/01/2017 4:46 a.m., Alex Rousskov wrote:
>> On 01/11/2017 08:29 AM, Amos Jeffries wrote:
>>> On 1/01/2017 6:37 p.m., Amos Jeffries wrote:
 The USE_CHUNKEDMEMPOOLS build-time setting is not very useful and adds
 extra complexity to the build system. Even when set it does not always
 enable chunked pools. The environment variable MEMPOOLS can easily be
 used to enable or disable chunked pools as needed.

>>>
>>> If there are no objections I would like to commit this shortly.
>>
>> None from me, but I did not study the patch closely. FWIW, adjusting the
>> commit message to explicitly say whether this change alters any
>> defaults, may help those assessing the change impact on their setups.
>>
>>
>> Thank you,
>>
>> Alex.
>>
>
> It does not change any defaults or behaviour for the vast majority of
> Squid installs. But anyone who was building custom with
> CXXFLAGS="-DUSE_CHUNKEDMEMPOOLS=1" will now have to use the run-time
> environment variable.
>
> Amos
>
> ___
> squid-dev mailing list
> squid-dev@lists.squid-cache.org
> http://lists.squid-cache.org/listinfo/squid-dev



-- 
Francesco
___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] Reduce crashes due to unexpected ClientHttpRequest termination.

2017-01-11 Thread Christos Tsantilas

On 11/01/2017 04:50 μμ, Amos Jeffries wrote:

On 11/01/2017 10:55 p.m., Christos Tsantilas wrote:

We observed such problems on squid shutdown procedure and during regular
squid operation. Any clientStreams redesign should take care of such
problems.

The underlying problem has been known since r13480: If a
ClientHttpRequest job ends without Http::Stream (and ConnStateData)
knowledge, then Squid is likely to segfault or assert.

This patch does not resolve the underlying issue (a proper fix would
require architectural changes in a consensus-lacking area) but makes an
unexpected ClientHttpRequest job destruction less likely.

BodyPipe and Adaptation-related exceptions are the major causes of
unexpected ClientHttpRequest job destruction. This patch handles them by
closing the client connection. Connection closure should trigger an
orderly top-down cleanup, including Http::Stream, ConnStateData, and
ClientHttpRequest destruction.

If there is no connection to close, then the exception is essentially
ignored with a level-1 error message disclosing the problem. The side
effects of ignoring such exceptions are unknown, but without a client
connection, it is our hope that they would be relatively benign.

This is a Measurement Factory project



+1. Looks like a reasonable temporary fix. Thank you.


The  t5 patch which has minor fixes over the posted patch applied to 
squid-5 branch as r15004.


The same patch apply as is to squid-4 branch.
I am also attaching the patch for squid-3.5




Amos


Reduce crashes due to unexpected ClientHttpRequest termination.

The underlying problem has been known since r13480: If a
ClientHttpRequest job ends without Http::Stream (and ConnStateData)
knowledge, then Squid is likely to segfault or assert. This patch does
not resolve the underlying issue (a proper fix would require
architectural changes in a consensus-lacking area) but makes an
unexpected ClientHttpRequest job destruction less likely.

BodyPipe and Adaptation-related exceptions are the major causes of
unexpected ClientHttpRequest job destruction. This patch handles them by
closing the client connection. Connection closure should trigger an
orderly top-down cleanup, including Http::Stream, ConnStateData, and
ClientHttpRequest destruction.

If there is no connection to close, then the exception is essentially
ignored with a level-1 error message disclosing the problem. The side
effects of ignoring such exceptions are unknown, but without a client
connection, it is our hope that they would be relatively benign.

This is a Measurement Factory project.

=== modified file 'src/client_side_request.cc'
--- src/client_side_request.cc	2017-01-01 00:16:45 +
+++ src/client_side_request.cc	2017-01-11 18:15:01 +
@@ -2063,22 +2063,36 @@
 noAddr.setNoAddr();
 ConnStateData * c = getConn();
 calloutContext->error = clientBuildError(ERR_ICAP_FAILURE, Http::scInternalServerError,
 NULL,
 c != NULL ? c->clientConnection->remote : noAddr,
 request
 );
 #if USE_AUTH
 calloutContext->error->auth_user_request =
 c != NULL && c->getAuth() != NULL ? c->getAuth() : request->auth_user_request;
 #endif
 calloutContext->error->detailError(errDetail);
 calloutContext->readNextRequest = true;
 if (c != NULL)
 c->expectNoForwarding();
 doCallouts();
 }
 //else if(calloutContext == NULL) is it possible?
 }
 
+void
+ClientHttpRequest::callException(const std::exception )
+{
+const Comm::ConnectionPointer clientConn = getConn() ? getConn()->clientConnection : NULL;
+if (Comm::IsConnOpen(clientConn)) {
+debugs(85, 3, "closing after exception: " << ex.what());
+clientConn->close(); // initiate orderly top-to-bottom cleanup
+return;
+}
+debugs(85, DBG_IMPORTANT, "ClientHttpRequest exception without connection. Ignoring " << ex.what());
+// XXX: Normally, we mustStop() but we cannot do that here because it is
+// likely to leave Http::Stream and ConnStateData with a dangling http
+// pointer. See r13480 or XXX in Http::Stream class description.
+}
 #endif
 

=== modified file 'src/client_side_request.h'
--- src/client_side_request.h	2017-01-01 00:16:45 +
+++ src/client_side_request.h	2017-01-11 17:53:13 +
@@ -96,40 +96,41 @@
 } flags;
 
 struct {
 Http::StatusCode status;
 char *location;
 } redirect;
 
 dlink_node active;
 dlink_list client_stream;
 int mRangeCLen();
 
 ClientRequestContext *calloutContext;
 void doCallouts();
 
 #if USE_ADAPTATION
 // AsyncJob virtual methods
 virtual bool doneAll() const {
 return Initiator::doneAll() &&
BodyConsumer::doneAll() && false;
 }
+virtual void callException(const std::exception );
 #endif
 
 private:
 int64_t 

Re: [squid-dev] [PATCH] remove USE_CHUNKEDMEMPOOLS

2017-01-11 Thread Amos Jeffries
On 12/01/2017 4:46 a.m., Alex Rousskov wrote:
> On 01/11/2017 08:29 AM, Amos Jeffries wrote:
>> On 1/01/2017 6:37 p.m., Amos Jeffries wrote:
>>> The USE_CHUNKEDMEMPOOLS build-time setting is not very useful and adds
>>> extra complexity to the build system. Even when set it does not always
>>> enable chunked pools. The environment variable MEMPOOLS can easily be
>>> used to enable or disable chunked pools as needed.
>>>
>>
>> If there are no objections I would like to commit this shortly.
> 
> None from me, but I did not study the patch closely. FWIW, adjusting the
> commit message to explicitly say whether this change alters any
> defaults, may help those assessing the change impact on their setups.
> 
> 
> Thank you,
> 
> Alex.
> 

It does not change any defaults or behaviour for the vast majority of
Squid installs. But anyone who was building custom with
CXXFLAGS="-DUSE_CHUNKEDMEMPOOLS=1" will now have to use the run-time
environment variable.

Amos

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] remove USE_CHUNKEDMEMPOOLS

2017-01-11 Thread Alex Rousskov
On 01/11/2017 08:29 AM, Amos Jeffries wrote:
> On 1/01/2017 6:37 p.m., Amos Jeffries wrote:
>> The USE_CHUNKEDMEMPOOLS build-time setting is not very useful and adds
>> extra complexity to the build system. Even when set it does not always
>> enable chunked pools. The environment variable MEMPOOLS can easily be
>> used to enable or disable chunked pools as needed.
>>
> 
> If there are no objections I would like to commit this shortly.

None from me, but I did not study the patch closely. FWIW, adjusting the
commit message to explicitly say whether this change alters any
defaults, may help those assessing the change impact on their setups.


Thank you,

Alex.

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] remove USE_CHUNKEDMEMPOOLS

2017-01-11 Thread Amos Jeffries
On 1/01/2017 6:37 p.m., Amos Jeffries wrote:
> The USE_CHUNKEDMEMPOOLS build-time setting is not very useful and adds
> extra complexity to the build system. Even when set it does not always
> enable chunked pools. The environment variable MEMPOOLS can easily be
> used to enable or disable chunked pools as needed.
> 

If there are no objections I would like to commit this shortly.

Amos

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] External ACL helpers error handling & caching

2017-01-11 Thread Amos Jeffries
On 10/01/2017 12:49 a.m., Christos Tsantilas wrote:
> The helper protocol for external ACLs [1] defines three possible return
> values:
>OK - Success. ACL test matches.
>ERR - Success. ACL test fails to match.
>BH - Failure. The helper encountered a problem.
> 
> The external acl helpers distributed with squid currently doesn't follow
> this definition. For example, upon connection error, ERR is returned:
> 
>$ ext_ldap_group_acl ... -d
>ext_ldap_group_acl: WARNING: could not bind to binddn 'Can't contact
> LDAP server'
>ERR
> 
>  This is does not allow to distinguish "no match" and "error" either and
> therefore negative caches "ERR", also in the case of an error.
> 
> Moreover there are multiple problems inside squid when trying to handle
> BH responses:
>   - Squid-5 and squid-4 retries requests for BH responses but crashes
> after the maximum retry number (currently 2) is reached.
>   - If an external acl helper return always BH (eg because the LDAP
> server is down) squid sends infinitely new request to the helper.
> 
> This patch fixes the problems described above.
> 
> This is a Measurement Factory project
> 

Thank you for this long overdue fix.

+1. Though if possible I would like one extra change...

Please add the below method to class external_acl and use it to
de-duplicate the complex if-conditions in external_acl_cache_touch and
external_acl_cache_add about whether a response is non-cacheable:

bool
external_acl::maybeCacheable(const allow_t )
{
if (cache_size <= 0)
return false; // cache is disabled

if (result == ACCESS_DUNNO)
return false; // non-cacheable response

if ((result == ACCESS_ALLOWED ? ttl : negative_ttl) <= 0)
return false; // not caching this type of response

return true;
}


Could you also mention for the squid-dev record how much testing this
patch has had.

Cheers
Amos

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] Reduce crashes due to unexpected ClientHttpRequest termination.

2017-01-11 Thread Amos Jeffries
On 11/01/2017 10:55 p.m., Christos Tsantilas wrote:
> We observed such problems on squid shutdown procedure and during regular
> squid operation. Any clientStreams redesign should take care of such
> problems.
> 
> The underlying problem has been known since r13480: If a
> ClientHttpRequest job ends without Http::Stream (and ConnStateData)
> knowledge, then Squid is likely to segfault or assert.
> 
> This patch does not resolve the underlying issue (a proper fix would
> require architectural changes in a consensus-lacking area) but makes an
> unexpected ClientHttpRequest job destruction less likely.
> 
> BodyPipe and Adaptation-related exceptions are the major causes of
> unexpected ClientHttpRequest job destruction. This patch handles them by
> closing the client connection. Connection closure should trigger an
> orderly top-down cleanup, including Http::Stream, ConnStateData, and
> ClientHttpRequest destruction.
> 
> If there is no connection to close, then the exception is essentially
> ignored with a level-1 error message disclosing the problem. The side
> effects of ignoring such exceptions are unknown, but without a client
> connection, it is our hope that they would be relatively benign.
> 
> This is a Measurement Factory project
> 

+1. Looks like a reasonable temporary fix. Thank you.

Amos

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


[squid-dev] [PATCH] Reduce crashes due to unexpected ClientHttpRequest termination.

2017-01-11 Thread Christos Tsantilas
We observed such problems on squid shutdown procedure and during regular 
squid operation. Any clientStreams redesign should take care of such 
problems.


The underlying problem has been known since r13480: If a 
ClientHttpRequest job ends without Http::Stream (and ConnStateData) 
knowledge, then Squid is likely to segfault or assert.


This patch does not resolve the underlying issue (a proper fix would 
require architectural changes in a consensus-lacking area) but makes an 
unexpected ClientHttpRequest job destruction less likely.


BodyPipe and Adaptation-related exceptions are the major causes of 
unexpected ClientHttpRequest job destruction. This patch handles them by 
closing the client connection. Connection closure should trigger an 
orderly top-down cleanup, including Http::Stream, ConnStateData, and 
ClientHttpRequest destruction.


If there is no connection to close, then the exception is essentially 
ignored with a level-1 error message disclosing the problem. The side 
effects of ignoring such exceptions are unknown, but without a client 
connection, it is our hope that they would be relatively benign.


This is a Measurement Factory project
Reduce crashes due to unexpected ClientHttpRequest termination.

The underlying problem has been known since r13480: If a
ClientHttpRequest job ends without Http::Stream (and ConnStateData)
knowledge, then Squid is likely to segfault or assert. This patch does
not resolve the underlying issue (a proper fix would require
architectural changes in a consensus-lacking area) but makes an
unexpected ClientHttpRequest job destruction less likely.

BodyPipe and Adaptation-related exceptions are the major causes of
unexpected ClientHttpRequest job destruction. This patch handles them by
closing the client connection. Connection closure should trigger an
orderly top-down cleanup, including Http::Stream, ConnStateData, and
ClientHttpRequest destruction.

If there is no connection to close, then the exception is essentially
ignored with a level-1 error message disclosing the problem. The side
effects of ignoring such exceptions are unknown, but without a client
connection, it is our hope that they would be relatively benign.

This is a Measurement Factory project.

=== modified file 'src/client_side_request.cc'
--- src/client_side_request.cc	2016-12-22 04:08:55 +
+++ src/client_side_request.cc	2017-01-10 21:59:46 +
@@ -2052,40 +2052,55 @@ ClientHttpRequest::handleAdaptationFailu
 
 if (bypassable && !usedStore && !usedPipe) {
 debugs(85,3, HERE << "ICAP REQMOD callout failed, bypassing: " << calloutContext);
 if (calloutContext)
 doCallouts();
 return;
 }
 
 debugs(85,3, HERE << "ICAP REQMOD callout failed, responding with error");
 
 clientStreamNode *node = (clientStreamNode *)client_stream.tail->prev->data;
 clientReplyContext *repContext = dynamic_cast(node->data.getRaw());
 assert(repContext);
 
 calloutsError(ERR_ICAP_FAILURE, errDetail);
 
 if (calloutContext)
 doCallouts();
 }
 
+void
+ClientHttpRequest::callException(const std::exception )
+{
+if (const auto clientConnection = getConn() ? getConn()->clientConnection : nullptr)
+if (Comm::IsConnOpen(clientConnection)) {
+debugs(85, 3, "closing after exception: " << ex.what());
+clientConnection->close(); // initiate orderly top-to-bottom cleanup
+return;
+}
+}
+debugs(85, DBG_IMPORTANT, "ERROR: ClientHttpRequest exception without connection. Ignoring " << ex.what());
+// XXX: Normally, we mustStop() but we cannot do that here because it is
+// likely to leave Http::Stream and ConnStateData with a dangling http
+// pointer. See r13480 or XXX in Http::Stream class description.
+}
 #endif
 
 // XXX: modify and use with ClientRequestContext::clientAccessCheckDone too.
 void
 ClientHttpRequest::calloutsError(const err_type error, const int errDetail)
 {
 // The original author of the code also wanted to pass an errno to
 // setReplyToError, but it seems unlikely that the errno reflects the
 // true cause of the error at this point, so I did not pass it.
 if (calloutContext) {
 Ip::Address noAddr;
 noAddr.setNoAddr();
 ConnStateData * c = getConn();
 calloutContext->error = clientBuildError(error, Http::scInternalServerError,
 NULL,
 c != NULL ? c->clientConnection->remote : noAddr,
 request
 );
 #if USE_AUTH
 calloutContext->error->auth_user_request =

=== modified file 'src/client_side_request.h'
--- src/client_side_request.h	2016-08-15 14:44:43 +
+++ src/client_side_request.h	2017-01-10 21:58:05 +
@@ -104,40 +104,41 @@ public:
 Http::StatusCode status;
 char *location;
 } redirect;
 
 dlink_node active;
 dlink_list