Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
hive
hivemind
Commits
4d93e2c6
Commit
4d93e2c6
authored
1 year ago
by
Dan Notestein
Committed by
Bartek Wrona
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
update_last_active_at even if context is already attached to avoid auto-detach race
parent
2fe59f10
No related branches found
No related tags found
1 merge request
!668
Changes done across v1.27.5.0-rc0 - v1.27.5.0-rc7 versions in the develop branch to be delivered to master
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
haf
+1
-1
1 addition, 1 deletion
haf
hive/indexer/hive_db/haf_functions.py
+5
-1
5 additions, 1 deletion
hive/indexer/hive_db/haf_functions.py
with
6 additions
and
2 deletions
haf
@
ebdd31df
Compare
a766d5ee
...
ebdd31df
Subproject commit
a766d5eec21735f9c1d12ee5e19a9d0defa675f5
Subproject commit
ebdd31df41a55acaf6cac6accd43a27223445b42
This diff is collapsed.
Click to expand it.
hive/indexer/hive_db/haf_functions.py
+
5
−
1
View file @
4d93e2c6
...
...
@@ -36,7 +36,11 @@ def context_detach(db: Db) -> None:
def
context_attach
(
db
:
Db
,
block_number
:
int
)
->
None
:
is_attached
=
db
.
query_one
(
f
"
SELECT hive.app_context_is_attached(
'
{
SCHEMA_NAME
}
'
)
"
)
if
is_attached
:
log
.
info
(
"
Context already attached - attaching skipped.
"
)
#Update last_active_at to avoid context being detached by auto-detacher prior to call to next_app_block.
#This is a workaround for current flaws in transaction management in hivemind, so it can be removed
#once transaction management is properly done (i.e. transactions should start/end when hivemind is consistent with a block)
db
.
query_no_return
(
f
"
SELECT hive.app_update_last_active_at(
'
{
SCHEMA_NAME
}
'
)
"
);
log
.
info
(
"
Context already attached - attaching skipped, but last_active_at updated.
"
)
return
log
.
info
(
f
"
Trying to attach app context with block number:
{
block_number
}
"
)
...
...
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