Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Domain Data Mgmt Services
Seismic
Open ZGY
Commits
6ba0639c
Commit
6ba0639c
authored
Jul 05, 2021
by
Paal Kvamme
Browse files
Allow configuring seismic store back-off via an environment variable.
parent
87f10dde
Changes
1
Show whitespace changes
Inline
Side-by-side
native/src/impl/file_sd.cpp
View file @
6ba0639c
...
...
@@ -47,11 +47,13 @@
#include
<SDGenericDataset.h>
#include
<SDUtils.h>
#include
<Constants.h>
#include
<HttpContext.h>
#else
#include
<SDAPI/SDManager.h>
#include
<SDAPI/SDGenericDataset.h>
#include
<SDAPI/SDUtils.h>
#include
<SDAPI/Constants.h>
#include
<SDAPI/HttpContext.h>
#endif
/** \cond SSTORE */
...
...
@@ -932,6 +934,38 @@ public:
}
}
}
/**
* Configure the exponential backoff used by Seismic Store.
* Only expected to be used for debugging.
*
* * -1 => use defaults.
* * 0 => Turn off exponential backoff completely.
* * >0 =? Set maximum repeat count.
*/
void
setBackoff
()
{
int
retries
=
Environment
::
getNumericEnv
(
"OPENZGY_SD_BACKOFF"
,
-
1
);
if
(
retries
>=
0
)
{
seismicdrive
::
ExponentialRetryBackoffPolicy
policy
;
if
(
retries
==
0
)
{
policy
.
enabled
=
false
;
}
else
{
policy
.
enabled
=
true
;
policy
.
maxRetry
=
retries
;
policy
.
initialWaitingTimeMicroSec
=
500
*
1000
;
policy
.
maxWaitingTimeMicroSec
=
32
*
1000
*
1000
;
}
dataset_
->
setExponentialRetryBackoffPolicy
(
&
policy
);
if
(
SeismicStoreFile
::
_logger
(
2
,
""
))
SeismicStoreFile
::
_logger
(
2
,
std
::
stringstream
()
<<
std
::
boolalpha
<<
"Backoff enabled "
<<
policy
.
enabled
<<
" retries "
<<
policy
.
maxRetry
<<
" start "
<<
(
float
)
policy
.
initialWaitingTimeMicroSec
*
1.0e-6
<<
" max "
<<
(
float
)
policy
.
maxWaitingTimeMicroSec
*
1.0e-6
);
}
}
};
SDGenericDatasetWrapper
::~
SDGenericDatasetWrapper
()
...
...
@@ -1040,6 +1074,8 @@ SeismicStoreFile::SeismicStoreFile(const std::string& filename, OpenMode mode, c
dataset
->
open
(
seismicdrive
::
SDDatasetDisposition
::
OVERWRITE
,
extra
);
break
;
}
if
(
mode
!=
OpenMode
::
Closed
)
datasetwrapper
->
setBackoff
();
}
catch
(
const
std
::
exception
&
ex
)
{
SeismicStoreFile
::
_logger
(
1
,
std
::
stringstream
()
...
...
Write
Preview
Supports
Markdown
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