You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like a possible bug, but maybe it isn’t. It’d be good to verify and comment.
When deleting a Host, it can happen, that a host has been already deleted by a different request before iteration finishes. I am not sure, whether the sqlalchemy.orm.exc.ObjectDeletedError is actually raised when the id property is accessed or when iterating. The latter looks more probable to me, but I don’t know the internal workings of SQLAlchemy.
It’s also possible that #392 will cause that the exception is never raised, because the property is no longer going to be accessed. Also I am not sure, what the synchronize_session="fetch" argument for the delete does and why there is an explicit DB commit.
All this should be properly commented and for that it’s necessary to research and verify the actual workings. Such a complex functionality also has to be covered by tests, although here multiprocessing is required and such test is going to be non-trivial.
The text was updated successfully, but these errors were encountered:
It seems as though I was mistaken about my previous comment on this issue. Through alot more testing I have found that without the changes made in PR #392 the ObjectDeletedError is not catching at all. In fact it continues to run even though the host has been deleted as if nothing happened at all.
Yeah me too! I was wondering why the test I was writing wasn't working so I decided to give it another look and it turns out your original idea was absolutely right.
I'm curious why the catch works with #392, I think you were absolutely right about that one as well with the accessing of the host during the printing of the deletion event.
This looks like a possible bug, but maybe it isn’t. It’d be good to verify and comment.
When deleting a Host, it can happen, that a host has been already deleted by a different request before iteration finishes. I am not sure, whether the sqlalchemy.orm.exc.ObjectDeletedError is actually raised when the id property is accessed or when iterating. The latter looks more probable to me, but I don’t know the internal workings of SQLAlchemy.
It’s also possible that #392 will cause that the exception is never raised, because the property is no longer going to be accessed. Also I am not sure, what the synchronize_session="fetch" argument for the delete does and why there is an explicit DB commit.
All this should be properly commented and for that it’s necessary to research and verify the actual workings. Such a complex functionality also has to be covered by tests, although here multiprocessing is required and such test is going to be non-trivial.
The text was updated successfully, but these errors were encountered: