Skip to content
GitLab
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 Management Services
Seismic
Open ZGY
Commits
a0e5c112
Commit
a0e5c112
authored
Aug 19, 2021
by
Paal Kvamme
Browse files
Expose the maximum retry count for Seismic Store requests.
parent
3546364f
Pipeline
#59709
passed with stages
in 11 minutes and 1 second
Changes
4
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
native/src/impl/file_sd.cpp
View file @
a0e5c112
...
...
@@ -1207,7 +1207,7 @@ SeismicStoreFile::_sslogger(int priority, const std::ios& ss) const
void
SeismicStoreFile
::
_set_backoff
(
seismicdrive
::
SDGenericDataset
*
sdgd
)
{
int
retries
=
Environment
::
getNumericEnv
(
"OPENZGY_SD_BACKOFF"
,
-
1
)
;
const
int
retries
=
this
->
_config
->
_retry_count
;
if
(
retries
>=
0
)
{
seismicdrive
::
ExponentialRetryBackoffPolicy
policy
;
if
(
retries
==
0
)
{
...
...
native/src/iocontext.cpp
View file @
a0e5c112
...
...
@@ -60,6 +60,7 @@ SeismicStoreIOContext::SeismicStoreIOContext()
setRoAfterWrite
(
Environment
::
getNumericEnv
(
"OPENZGY_RO_AFTER_WRITE"
,
1
)
>
0
);
forceRoBeforeRead
(
Environment
::
getNumericEnv
(
"OPENZGY_RO_BEFORE_READ"
,
0
)
>
0
);
forceRwBeforeWrite
(
Environment
::
getNumericEnv
(
"OPENZGY_RW_BEFORE_WRITE"
,
0
)
>
0
);
retryCount
(
Environment
::
getNumericEnv
(
"OPENZGY_SD_BACKOFF"
,
-
1
));
}
std
::
string
...
...
native/src/iocontext.h
View file @
a0e5c112
...
...
@@ -120,6 +120,7 @@ private:
bool
_set_ro_after_write
;
bool
_force_ro_before_read
;
bool
_force_rw_before_write
;
std
::
int32_t
_retry_count
;
private:
// really private. Keep off.
std
::
int64_t
_real_segsize
;
...
...
@@ -546,6 +547,19 @@ public:
return
*
this
;
}
/**
* Maximum number of retries that SDAPI will use before concluding
* that a web service is unavailable and not just experiencing a
* transient problem. There is an exponential backoff between
* attempts. 1/2 second for the first one, then doubling for each
* attempt but never more than 32 seconds. Leaving the parameter
* unset or set to -1 will use the defaults hard coded in SDAPI.
*/
SeismicStoreIOContext
&
retryCount
(
int
value
)
{
this
->
_retry_count
=
value
;
return
*
this
;
}
};
/** \endcond */
...
...
native/src/test/test_api.cpp
View file @
a0e5c112
...
...
@@ -2390,6 +2390,10 @@ test_sderrors()
SeismicStoreIOContext
context
(
*
Test_Utils
::
default_sd_context
());
// SDAPI should not retry a missing token, but currently there
// is a bug that does just that. Explicitly turn off retries.
context
.
retryCount
(
0
);
// Neither token not token callback were provided.
context
.
sdtoken
(
""
,
""
);
must_throw
(
"Missing access token or callback in iocontext"
,
[
&
](){
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment