Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
core
picodata
Commits
40e9e02e
Verified
Commit
40e9e02e
authored
10 months ago
by
Denis Smirnov
Browse files
Options
Downloads
Patches
Plain Diff
fix: lua function signature in a case of errors
parent
6754ddcb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1414
sbroad import
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sbroad-core/src/core-router.lua
+15
-3
15 additions, 3 deletions
sbroad-core/src/core-router.lua
with
15 additions
and
3 deletions
sbroad-core/src/core-router.lua
+
15
−
3
View file @
40e9e02e
...
...
@@ -2,6 +2,8 @@
-- Function, described in this file are called from `vshard` Sbroad module.
local
vshard
=
require
(
'vshard'
)
local
lerror
=
require
(
'vshard.error'
)
local
vrs
=
require
(
'vshard.replicaset'
)
local
helper
=
require
(
'sbroad.helper'
)
local
fiber
=
require
(
'fiber'
)
local
table
=
require
(
'table'
)
...
...
@@ -11,11 +13,11 @@ local DQL_MIN_TIMEOUT = 10
local
function
future_wait
(
cond
,
timeout
)
local
f
=
function
(
cond
,
timeout
)
if
timeout
and
timeout
<
0
then
error
(
"dql timeout exceeded"
)
return
nil
,
lerror
.
make
(
"dql timeout exceeded"
)
end
local
res
,
err
=
cond
:
wait_result
(
timeout
)
if
err
then
error
(
err
)
return
nil
,
lerror
.
make
(
err
)
end
return
res
end
...
...
@@ -23,7 +25,7 @@ local function future_wait(cond, timeout)
if
ok
then
return
res
end
return
nil
,
res
return
nil
,
lerror
.
make
(
res
)
end
--
...
...
@@ -80,6 +82,10 @@ local function multi_storage_dql(uuid_to_args, func, vtable_max_rows, opts)
-- Nil checks are done explicitly here (== nil instead of 'not'), because
-- netbox requests return box.NULL instead of nils.
-- Wait for all masters to connect.
vrs
.
wait_masters_connect
(
replicasets
)
timeout
=
deadline
-
fiber
.
clock
()
--
-- Ref stage: send.
--
...
...
@@ -252,6 +258,9 @@ _G.dql_on_some = function(uuid_to_args, is_readonly, waiting_timeout, vtable_max
if
err
~=
nil
then
helper
.
dql_error
(
err
,
err_uuid
)
end
if
result
==
nil
then
error
(
"local execution returned nil"
)
end
end
return
box
.
tuple
.
new
{
result
}
...
...
@@ -272,6 +281,9 @@ _G.dql_on_all = function(required, optional, waiting_timeout, vtable_max_rows)
if
err
~=
nil
then
helper
.
dql_error
(
err
,
err_uuid
)
end
if
result
==
nil
then
error
(
"local execution returned nil"
)
end
return
box
.
tuple
.
new
{
result
}
end
...
...
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