Skip to content

Commit

Permalink
Make "resource temporarily unavailable" an external error
Browse files Browse the repository at this point in the history
Do not add Modules issue report web link when facing a "resource
temporarily unavailable" error when forking sub-process like logger or
pager.

Fixes #546
  • Loading branch information
xdelaruelle committed Sep 20, 2024
1 parent fc2fe89 commit 08d81f5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Modules 5.5.0 (not yet released)
specification as long as the string following them is not a valid variant
name (e.g., ``foo/1.2+8``). (fix issue #527)
* In case of an issue external to Modules, do not mention at the end of the
error stack trace the web link to report this issue.
error stack trace the web link to report this issue. (fix issue #546)
* When a modulefile performs a :mfcmd:`module unload<module>` command that
fails due to dependent modules loaded, stop unload evaluation right after
this failed command unless :option:`--force` option is used.
Expand Down
1 change: 1 addition & 0 deletions tcl/report.tcl.in
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,7 @@ proc reportFinalError {error_msg} {
{Can't find a usable init.tcl in the following directories}\
{interpreter uses an incompatible stubs mechanism}\
{dlopen(}\
{couldn't fork child process: resource temporarily unavailable}\
{invalid command name "tcl::mathfunc::max"}]
set add_report_link 1
foreach external_error $external_error_list {
Expand Down
5 changes: 5 additions & 0 deletions testsuite/example/siteconfig.tcl-1
Original file line number Diff line number Diff line change
Expand Up @@ -633,5 +633,10 @@ This probably means that Tcl wasn't installed properly.}
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLINIT)]} {
rename tcl::mathfunc::max {}
}
if {[info exists env(TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORRESSOURCEUNAVAIL)]} {
proc reportVersion {} {
error {couldn't fork child process: resource temporarily unavailable}
}
}

}
11 changes: 11 additions & 0 deletions testsuite/modules.00-init/120-siteconfig.exp
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,17 @@ lappend ans { "{*}$execcmdlist"}
testouterr_cmd sh {avail} ERR [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORTCLINIT

setenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORRESSOURCEUNAVAIL 1
set ans [list]
lappend ans "$error_msgs: couldn't fork child process: resource temporarily unavailable"
lappend ans { while executing}
lappend ans { "error {couldn't fork child process: resource temporarily unavailable}"}
lappend ans { (procedure "reportVersion" line 2)}
lappend ans { invoked from within}
lappend ans { "reportVersion"}
testouterr_cmd sh {-V} ERR [join $ans \n]
unsetenv_var TESTSUITE_ENABLE_SITECONFIG_EXTERNALERRORRESSOURCEUNAVAIL


} elseif {$verbose} {
send_user "\tSkip tests relying on an excepted siteconfig file installed\n"
Expand Down

0 comments on commit 08d81f5

Please sign in to comment.