Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
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
tarantool
Commits
ebcf369a
Commit
ebcf369a
authored
10 years ago
by
Roman Tsisyk
Browse files
Options
Downloads
Patches
Plain Diff
Fix #420: fiber.cancel() assertion `!(f->flags & (1 << 2))' failed
parent
a9c4991d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/fiber.cc
+6
-1
6 additions, 1 deletion
src/fiber.cc
test/box/fiber.result
+14
-0
14 additions, 0 deletions
test/box/fiber.result
test/box/fiber.test
+5
-0
5 additions, 0 deletions
test/box/fiber.test
with
25 additions
and
1 deletion
src/fiber.cc
+
6
−
1
View file @
ebcf369a
...
...
@@ -133,7 +133,6 @@ void
fiber_cancel
(
struct
fiber
*
f
)
{
assert
(
f
->
fid
!=
0
);
assert
(
!
(
f
->
flags
&
FIBER_CANCEL
));
f
->
flags
|=
FIBER_CANCEL
;
...
...
@@ -180,6 +179,12 @@ fiber_is_cancelled()
void
fiber_testcancel
(
void
)
{
/*
* Fiber can catch FiberCancelException using try..catch block in C or
* pcall()/xpcall() in Lua. However, FIBER_CANCEL flag is still set
* and the subject fiber will be killed by subsequent unprotected call
* of this function.
*/
if
(
fiber_is_cancelled
())
tnt_raise
(
FiberCancelException
);
}
...
...
This diff is collapsed.
Click to expand it.
test/box/fiber.result
+
14
−
0
View file @
ebcf369a
No preview for this file type
This diff is collapsed.
Click to expand it.
test/box/fiber.test
+
5
−
0
View file @
ebcf369a
...
...
@@ -113,3 +113,8 @@ exec admin "lua f = box.fiber.wrap(y)"
exec
admin
"lua box.fiber.kill(f:id())"
exec
admin
"lua while box.fiber.status(f) ~= 'dead' do box.fiber.sleep(0.01) end"
exec
admin
"lua box.space[0]:truncate()"
exec
admin
"lua done = false"
exec
admin
"lua function test() box.fiber.name('cancel_bug'); local fun, errmsg = loadstring('box.fiber.cancel(box.fiber.self())'); xpcall(fun, function() end); xpcall(fun, function() end); done = true; fun(); end"
exec
admin
"lua box.fiber.wrap(test)"
exec
admin
"lua done"
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