Skip to content

Commit e19b91d

Browse files
authored
release zypp lock after software finish action (bsc#1258188) (#3271)
## Problem It is not possible to have zypper call in post install scripts as agama still holding zypp lock. - https://bugzilla.suse.com/show_bug.cgi?id=1258188 ## Solution release zypp lock together with finish action which should be the last one software stack do. ## Testing - *Tested manually* with post install script and zypper works.
2 parents a9e203c + 0009c37 commit e19b91d

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

rust/agama-software/src/zypp_server.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,19 @@ impl ZyppServer {
200200
break;
201201
};
202202

203-
if let Err(error) = self.dispatch(action, &zypp) {
204-
tracing::error!("Software dispatch error: {:?}", error);
205-
}
203+
match self.dispatch(action, &zypp) {
204+
Ok(false) => {
205+
break;
206+
}
207+
Err(error) => {
208+
tracing::error!("Software dispatch error: {:?}", error);
209+
}
210+
_ => {}
211+
};
206212
}
207213

214+
// drop explicitly zypp to release lock ASAP
215+
drop(zypp);
208216
Ok(())
209217
}
210218

@@ -213,7 +221,7 @@ impl ZyppServer {
213221
&mut self,
214222
action: SoftwareAction,
215223
zypp: &zypp_agama::Zypp,
216-
) -> Result<(), ZyppDispatchError> {
224+
) -> Result<bool, ZyppDispatchError> {
217225
match action {
218226
SoftwareAction::Write {
219227
state,
@@ -242,12 +250,14 @@ impl ZyppServer {
242250
}
243251
SoftwareAction::Finish(tx) => {
244252
self.finish(zypp, tx)?;
253+
// stop server after finish action to release zypp lock ASAP.
254+
return Ok(false);
245255
}
246256
SoftwareAction::GetProposal(product_spec, sender) => {
247257
self.proposal(product_spec, sender, zypp)?
248258
}
249259
}
250-
Ok(())
260+
Ok(true)
251261
}
252262

253263
// Install rpms

rust/package/agama.changes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-------------------------------------------------------------------
2+
Fri Mar 13 10:54:49 UTC 2026 - Josef Reidinger <jreidinger@suse.com>
3+
4+
- Release zypp lock after software finish to allow run zypper
5+
in post install scripts (bsc#1258188)
6+
17
-------------------------------------------------------------------
28
Thu Mar 12 13:20:48 UTC 2026 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>
39

0 commit comments

Comments
 (0)