Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CVMFS monitor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cernvm
CVMFS monitor
Commits
4d295d6f
Commit
4d295d6f
authored
4 years ago
by
Jakob Blomer
Browse files
Options
Downloads
Plain Diff
Merge branch 'fix-remount' into 'master'
update libcvmfs to revision 30 See merge request
!11
parents
e456087d
d1a419b6
Branches
Branches containing commit
No related tags found
1 merge request
!11
update libcvmfs to revision 30
Pipeline
#2143712
passed
4 years ago
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/Dockerfile
+1
-1
1 addition, 1 deletion
backend/Dockerfile
backend/libcvmfs_node.cc
+27
-3
27 additions, 3 deletions
backend/libcvmfs_node.cc
with
28 additions
and
4 deletions
backend/Dockerfile
+
1
−
1
View file @
4d295d6f
...
...
@@ -10,7 +10,7 @@ USER root
RUN
yum
install
-y
openssl libuuid-devel libcurl-devel
RUN
curl http://ecsft.cern.ch/dist/cvmfs/nightlies/cvmfs-git-2
290
/cvmfs-devel-2.8.0-0.2
290.cb9d83072de7a5e9
git.el8.x86_64.rpm
>
/root/cvmfs-devel.rpm
RUN
curl http
s
://ecsft.cern.ch/dist/cvmfs/nightlies/cvmfs-git-2
628
/cvmfs-devel-2.8.0-0.2
628.e21d38cda9eb95fe
git.el8.x86_64.rpm
>
/root/cvmfs-devel.rpm
RUN
rpm
-i
/root/cvmfs-devel.rpm
RUN
curl http://ecsft.cern.ch/dist/cvmfs/cvmfs-config/cvmfs-config-default-latest.noarch.rpm
>
/root/cvmfs-config.rpm
RUN
rpm
-i
/root/cvmfs-config.rpm
...
...
This diff is collapsed.
Click to expand it.
backend/libcvmfs_node.cc
+
27
−
3
View file @
4d295d6f
...
...
@@ -3,18 +3,28 @@
#include
<stdio.h>
#include
<map>
#include
<sstream>
#include
<time.h>
const
unsigned
int
kMaxPathLen
=
2000
;
// Root catalog TTL in seconds
const
unsigned
int
kDefaultTimeout
=
60
;
cvmfs_option_map
*
g_opts
;
cvmfs_context
*
g_ctx
;
std
::
map
<
std
::
string
,
cvmfs_context
*>
g_attached_repos
;
struct
AttachedRepository
{
cvmfs_context
*
ctx
;
// When to check next time for remount
time_t
timeout_deadline
;
};
std
::
map
<
std
::
string
,
AttachedRepository
>
g_attached_repos
;
bool
AttachRepo
(
const
std
::
string
&
repo
,
Napi
::
Env
env
)
{
cvmfs_option_map
*
opts
=
cvmfs_options_clone
(
g_opts
);
cvmfs_options_parse_default
(
opts
,
repo
.
c_str
());
cvmfs_context
*
context
;
printf
(
"[INF]: attaching repository %s
\n
"
,
repo
.
c_str
());
int
retcode
=
cvmfs_attach_repo_v2
(
repo
.
c_str
(),
opts
,
&
context
);
if
(
retcode
!=
0
)
{
std
::
stringstream
error_msg
;
...
...
@@ -24,7 +34,10 @@ bool AttachRepo(const std::string &repo, Napi::Env env) {
return
false
;
}
cvmfs_adopt_options
(
context
,
opts
);
g_attached_repos
[
repo
]
=
context
;
AttachedRepository
ar
;
ar
.
ctx
=
context
;
ar
.
timeout_deadline
=
time
(
NULL
)
+
kDefaultTimeout
;
g_attached_repos
[
repo
]
=
ar
;
return
true
;
}
...
...
@@ -32,7 +45,18 @@ cvmfs_context *GetRepoCtx(const std::string repo, Napi::Env env) {
if
(
g_attached_repos
.
count
(
repo
)
==
0
)
{
if
(
!
AttachRepo
(
repo
,
env
))
return
NULL
;
}
return
g_attached_repos
[
repo
];
if
(
time
(
NULL
)
>
g_attached_repos
[
repo
].
timeout_deadline
)
{
printf
(
"[INF]: remounting %s due to timeout
\n
"
,
repo
.
c_str
());
int
retval
=
cvmfs_remount
(
g_attached_repos
[
repo
].
ctx
);
if
(
retval
!=
0
)
{
std
::
stringstream
error_msg
;
error_msg
<<
"remounting "
<<
repo
<<
" failed (error code "
<<
retval
<<
")"
;
Napi
::
Error
::
New
(
env
,
error_msg
.
str
()).
ThrowAsJavaScriptException
();
}
else
{
g_attached_repos
[
repo
].
timeout_deadline
=
time
(
NULL
)
+
kDefaultTimeout
;
}
}
return
g_attached_repos
[
repo
].
ctx
;
}
void
FillStat
(
cvmfs_stat_t
*
st
,
Napi
::
Object
*
obj
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment