View · Index

Weblog

Filtered by date 2020-08-21, 1 - 2 of 2 Postings (all, summary)

OpenACS Community Wiki

Created by gustaf neumann, last modified by Gustaf Neumann 21 Aug 2020, at 04:54 PM

This is the OpenACS Wiki system, built with the xowiki package. This wiki contains user documentation, how-tos, and tips and tricks related to OpenACS. It also serves as a collaboration area for OpenACS contributors.

Quick Links:

Recent Wiki Page Edits:

Cookbook

Subsystems Documentation

Events

OpenACS Conferences (1 year ago)

HOME

External Resources

OpenACS Projects

Package Documentation

Tutorials for Administrators

OpenACS Monitoring (2 years ago)
rl_json (3 years ago)

Non-Core Packages

Chat (2 years ago)
XoWiki (2 years ago)
XOTcl Core (2 years ago)
xooauth (3 years ago)
xowf (XoWiki Workflow) (4 years ago)

Tutorials

for beginning developers (2 years ago)
Theming in OpenACS (4 years ago)

Documentation

Core Documentation

Installing OpenACS (2 years ago)

Coding Standards

Security Guidelines (3 years ago)
Coding Standards - Index (3 years ago)
Tcl Procs (3 years ago)
   

How to handle "connection already closed" errors

Created by Gustaf Neumann, last modified by Gustaf Neumann 21 Aug 2020, at 12:47 PM

Newer versions of NaviServer produce by default an error, when a script tries to write a connection, which as already closed by the server (e.g. doing two ad_returndirect in a sequence). Such program code does not make sense and indicates an error that should be fixed.

In general, one can silence the behavior or fix it. To silence the behavior, on can alter the NaviServer config file to silently swallow these error conditions named "rejectalreadyclosedconn". See e.g. Sample configuration file

Recent version of OpenACS (oacs-5-10) have such error conditions already fixed in all the actively maintained packages in the oacs-5-10 branch. In order to fix custom packages, one has to watch out for the following situations:

  • Request pages: all after every command that finishes a request a call to "ad_script_abort" is required. Such commands are essentially all "ns_return*" commands and the "ad_*" counterparts.
  • Filters: in case, an application handles such commands in filters, the filter has to return with "filter_return" to stop the filter chain (i.e. not to call further filters). Notice that the documentation of ns_register states that the request page is as well handled to trigger e.g. the access log entry. So, in rare conditions, one has to check as well for additional closed cases by using "ns_conn isconnected".

Sometimes, it might be still tricky to find such occurrences. On recent versions of OpenACS one can use the xo* machinery to activate/deactivate Tcl command traces for such commands via ds/shell, like e.g. in:

xo::broadcast send {
  set traced_cmds [info commands ::ns_return*]
  foreach cmd $traced_cmds {trace add execution $cmd  enter {::tcltrace::before}}
}

"xo::broadcast" sends the command to every tcl based thread that executes the provided command. Tracing can be deactivated by replacing "trace add" by "trace remove" in this command.

Plain OpenACS (in oacs-5-10) has as well some support for this via acs-tcl/tcl/tcltrace-init.tcl.

previous August 2020 next
Sun Mon Tue Wed Thu Fri Sat
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 (1) 11 12 13 14 15
16 17 18 19 20 (2) 21 22
23 (3) 24 25 (1) 26 (2) 27 28 29
30 31 1 2 3 4 5

Popular tags

17 , 5.10 , 5.10.0 , 5.10.1 , 5.9.0 , 5.9.1 , ad_form , ADP , ajax , aolserver , asynchronous , Azure , bgdelivery , bootstrap , bugtracker , CentOS , COMET , compatibility , conference , CSP , CSRF , cvs , debian , docker , docker-compose , emacs , engineering-standards , exec , fedora , FreeBSD
No registered users in community xowiki
in last 30 minutes
Contributors

OpenACS.org