Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-file
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-file
Commits
4ffe2ce0
Commit
4ffe2ce0
authored
Sep 22, 2019
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Write up the ERRORS section.
parent
24fab496
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
2 deletions
+76
-2
README.rst
README.rst
+38
-1
vmod_file.vcc
src/vmod_file.vcc
+38
-1
No files found.
README.rst
View file @
4ffe2ce0
...
...
@@ -271,6 +271,8 @@ Example::
synth_body.synth();
}
.. _reader.error():
.. _xreader.error():
BOOL xreader.error()
...
...
@@ -370,7 +372,42 @@ Example::
ERRORS
======
XXX ...
Methods that access a file's cached contents invoke VCL failure if
there was an error during the most recent update check, just as if
``return(fail)`` had been invoked in VCL. This means that:
* If the error occurs during ``vcl_init`` (on the initial read of the
file), then the VCL load fails with an error message.
* If the error occurs during any other subroutine besides
``vcl_synth``, then a ``VCL_Error`` message describing the problem
is written to the log, and control is immediately directed to
``vcl_synth``. In ``vcl_synth``, the response status
(``resp.status``) is set to 503, and the reason string
(``resp.reason``) is set to ``"VCL failed"``.
* If the error happens during ``vcl_synth``, then the ``VCL_Error``
message is written, ``vcl_synth`` is aborted. The response line
``"503 VCL failed"`` is set, but the client may just see connection
reset.
.. |reader.error()| replace:: ``reader.error()``
The |reader.error()|_ may be used to detect errors, for example to
implement different error handling in VCL.
Errors that may be encountered on the initial read or update checks
include:
* The ``stat(2)`` call to read file meta-data fails. This is what will
happen for typical file errors: when the file has been deleted, the
Varnish process cannot access it, or the process owner does not have
read permissions.
* The file is neither a regular file nor a symbolic link that points
to a regular file.
* Any of the internal calls to open and map the file fail.
REQUIREMENTS
============
...
...
src/vmod_file.vcc
View file @
4ffe2ce0
...
...
@@ -251,6 +251,8 @@ Example::
synth_body.synth();
}
.. _reader.error():
$Method BOOL .error()
Return true if and only if an error condition was determined the last
...
...
@@ -332,7 +334,42 @@ Example::
ERRORS
======
XXX ...
Methods that access a file's cached contents invoke VCL failure if
there was an error during the most recent update check, just as if
``return(fail)`` had been invoked in VCL. This means that:
* If the error occurs during ``vcl_init`` (on the initial read of the
file), then the VCL load fails with an error message.
* If the error occurs during any other subroutine besides
``vcl_synth``, then a ``VCL_Error`` message describing the problem
is written to the log, and control is immediately directed to
``vcl_synth``. In ``vcl_synth``, the response status
(``resp.status``) is set to 503, and the reason string
(``resp.reason``) is set to ``"VCL failed"``.
* If the error happens during ``vcl_synth``, then the ``VCL_Error``
message is written, ``vcl_synth`` is aborted. The response line
``"503 VCL failed"`` is set, but the client may just see connection
reset.
.. |reader.error()| replace:: ``reader.error()``
The |reader.error()|_ may be used to detect errors, for example to
implement different error handling in VCL.
Errors that may be encountered on the initial read or update checks
include:
* The ``stat(2)`` call to read file meta-data fails. This is what will
happen for typical file errors: when the file has been deleted, the
Varnish process cannot access it, or the process owner does not have
read permissions.
* The file is neither a regular file nor a symbolic link that points
to a regular file.
* Any of the internal calls to open and map the file fail.
REQUIREMENTS
============
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment