Index: openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl,v diff -u -r1.1.2.16 -r1.1.2.17 --- openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl 11 Jul 2024 05:19:05 -0000 1.1.2.16 +++ openacs-4/packages/acs-tcl/tcl/cluster-procs.tcl 8 Aug 2024 14:30:53 -0000 1.1.2.17 @@ -103,8 +103,9 @@ acs::cache_flush_all "" acs::cache_flush_pattern "" lang::message::cache "" + ad_parameter_cache_flush_dict "" ::acs::cluster "^::acs::cluster\s+join_request" - ::acs::cluster "^::acs::cluster\s+disconnect_request" + ::acs::cluster "^::acs::cluster\s+disconnect_request" } # @@ -276,7 +277,7 @@ set ok 1 break } - } + } } } } else { @@ -576,7 +577,7 @@ # entities, we have to map container-internal IP addresses # to external accessible addresses. # - ns_log notice "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX NO USED !!!!!!!!!!!!!!!" + ns_log notice "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX NOT USED !!!!!!!!!!!!!!!" set containerMapping [::acs::container mapping] if {$containerMapping ne ""} { set d [ns_parseurl $qualified_location] @@ -651,7 +652,7 @@ # dict set d host [ns_addrbyhost [dict get $d host]] } - + set d [:map_inaddr_any -dict $d] dict with d { set result [util::join_location -noabbrev -proto $proto -hostname $host -port $port] Index: openacs-4/packages/acs-tcl/tcl/defs-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/defs-procs.tcl,v diff -u -r1.81.2.29 -r1.81.2.30 --- openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 6 Aug 2024 17:25:04 -0000 1.81.2.29 +++ openacs-4/packages/acs-tcl/tcl/defs-procs.tcl 8 Aug 2024 14:30:53 -0000 1.81.2.30 @@ -523,6 +523,33 @@ nsv_set ad_param . . } + ad_proc -private ad_parameter_cache_flush_dict { + key + parmeter_name + } { + Flush a single value from the nsv cache. + + This proc is necessary in cases, where a node writes a new + parameter value before it has read the old one. + + Since a plain "nsv_dict unset ad_param $key $parameter_name" + raises an exception, when the pair does not exist, and we do + not want to allow in cluster requests arbitrary "catch" + commands, we allow "ad_parameter_cache_flush_dict" instead. + Probably, the best solution is to add support for + + nsv_dict unset -nocomplain -- ad_param $key $parameter_nam + + The existing nsv_dict was built after Tcl's "dict unset", + which does not have the "-nocomplain" option either. However, + an atomic operation would certainly be preferable over an exists/unset + pair, which is no acceptable solution. + + } { + catch {nsv_dict unset ad_param $key $parameter_name} + } + + ad_proc -public ad_parameter_cache { -set -delete:boolean @@ -542,9 +569,7 @@ } { if {$delete_p} { - if {[nsv_dict exists ad_param $key $parameter_name]} { - ::acs::clusterwide nsv_dict unset ad_param $key $parameter_name - } + acs::clusterwide ad_parameter_cache_flush_dict $key $parameter_name acs::per_request_cache flush -pattern acs-tcl.ad_param-$key return }