Skip to content

Conversation

@pjbgf
Copy link
Member

@pjbgf pjbgf commented Jun 16, 2022

Some scenarios may lead to deadlocks, specially in image automation controller.

Fix regression from #753 #775.

@pjbgf pjbgf added the area/git Git related issues and pull requests label Jun 16, 2022
Some scenarios may lead to deadlocks, specially
in image automation controller.

Signed-off-by: Paulo Gomes <[email protected]>
session *ssh.Session
currentStream *sshSmartSubtransportStream
connected bool
m sync.RWMutex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this approach, no more locking and safer.
This whole connection type was created in order to group these variables and lock them together. Since we no longer lock with this change, we can put them back into sshSmartSubtransport struct.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a commit with this change, as Paulo is away at the moment.

The connection type was created to group the connection related fields
and use mutex to prevent race conditions. Since that's no longer the
case, this puts back those fields in sshSmartSubtransport.

Signed-off-by: Sunny <[email protected]>
@darkowlzz darkowlzz requested a review from hiddeco June 21, 2022 12:47
@darkowlzz darkowlzz merged commit 2295134 into main Jun 21, 2022
@darkowlzz darkowlzz deleted the mutexless branch June 21, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/git Git related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants