Session not completely cleaned #1185
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1185
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
In Gitea at https://github.com/go-gitea/gitea/blob/master/models/issue.go#L1349
If we change the
LoadAttributes
function to perform its lookups within the same session the results are not the same as those without it, because it appears that at least some of the setup performed inopts.setupSession
is not reset following theFind
above.Although this doesn't present a problem at the moment because there is no transaction created and no changes are made to the database, the lack of a complete reset could cause unpredictable heisenbugs elsewhere.
OK, so the reason this appears to fail in Gitea is that the failure happens because
issues.loadAttachments(sess)
callsissues.loadLabels(sess)
:Now it appears that the line:
Causes xorm to issue:
The table label_issue doesn't exist.
Looking at
rows.go
:I suspect the problem lies in the last line:
rows.session.executeProcessors()
This should be a bug of xorm and I think it's on
Table("table_name").Rows()
. The table name haven't been used.