=== benfrancis0 is now known as benfrancis [05:56] morning [05:57] hey mborzecki [05:57] how are you doing? :) [05:57] happy Thursday [06:08] zyga-mbp: hey, yeah finally thursday, just one more day [06:09] good morning mborzecki, zyga-mbp [06:10] good morning mardy :) [06:11] mardy: hey, i've pushed an update to https://github.com/snapcore/snapd/pull/10860 and it looks like i fixed the sync & buffer corruption in tests 🙂 there's still a little problem with that signal thingy being null sometimes, haven't really seen it on real dbus, so i'm guessing it's something about partial reads in the tests [06:11] PR #10860: sandbox/cgroup: wait for start transient unit job to finish [06:12] woah, nie [06:12] *nice [06:22] Hi, i want to create an agent which manages the snap updates. to do that i would need to connect to snapd-control slot. But how do i use it? I read that it is using javascript file. But i have no idea how to use it. Could some one help me. [06:23] ares0128 there's some logic that makes snapd go to managed mode and disable auto-updates [06:23] then you have to call the snapd APIs to issue specific requests, like update that snap or all snaps [06:23] whenever your software decides [06:23] there's a bit of guard-rails around that feature, it's meant for core devices only [06:25] i tried following this https://github.com/dbruno74/node-red-node-snapd and https://github.com/madintec/snapd-control [06:25] but i dont know how to use these files [06:25] yeah i am making a snap for ubuntu core [06:25] ares0128 that secodn thing is just a library, if you need javascript you can use it but that's not the point [06:26] how do i call snapd APIs [06:26] snapd has a socket [06:26] it is through /run /snapd.socket [06:26] * zyga-mbp and a Go library to talk to it [06:26] * zyga-mbp the protocol is basically http over unix socket [06:26] * zyga-mbp the snap command actually talks to snapd over that socket [06:26] * zyga-mbp for snaps there's a second socket that lets snapctl talk to snapd [06:26] is there an example snap that i can refer to? [06:26] snapctl is the thing that snaps can use internally to manage parts of themselves [06:27] I don't recall but I'm sure there's something in the snapd test suite [06:29] ares0128 https://github.com/snapcore/snapd/blob/master/tests/main/interfaces-snapd-control-with-manage/task.yaml#L71 [06:29] ares0128 you get a snap with snapd-control [06:29] you can set the snap set setting "system refresh.shedule" to "managed" [06:30] and from there on you can just use snap to tell snapd to do things [06:30] I think you can literally bundle the snap command as a quick test [06:31] typically there are management agents implemented in whatever language [06:32] they talk to snapd either through the go binary [06:32] or through the C library [06:32] or through the Go library [06:32] there are official libraries to talk to snapd [06:32] and perhaps several unofficial ones [06:32] but the bulk of the idea is that you switch refreshes to managed and then you drive the refreshes yourself [06:33] so , i make a snap using go library that talks to snapd and chage the refresh to ,managed... [06:37] mborzecki: the Read() and Write() method of the testDBusStream, can they be invoked on the same object from two different threads? [06:39] (if so, you should protect that s.closed flag with a mutex) [06:52] and back :) [07:00] morning [07:03] hi pstolowski, mvo [07:03] good morning mardy and pstolowski [07:03] hey mardy and mvo [07:08] hey there pstolowski and mvo :) [07:09] good morning zyga-mbp [07:11] PR snapd#10844 closed: disks: add `Size(path)` helper [07:15] hey zyga-mbp ! [07:16] PR snapd#10856 closed: osutil/disks: add Disk.KernelDevice{Node,Path} methods [07:49] mardy: hm fixed that already with some refactor to Write() as the code wasn't correct, still no clue how we get that nil signal there, tbh i've been fighting with go modules at this point, modifyikg a forked library isn't exactly convenient now [07:50] mardy: can you take a look at https://github.com/snapcore/snapd/pull/10847 ? [07:50] PR #10847: cmd/snap-confine: die when snap process is outside of snap specific cgroup [07:52] mborzecki small review [07:52] /me is a bit afraid that tests.session is used so much in tests now [07:52] that thing is a gross hack [08:26] jamesh: https://github.com/stolowski/snapd/tree/notifications/monitor-closed [08:26] jamesh: the panic is in cmd/snap tests [08:27] * pstolowski dog walk, brb [08:35] re [08:44] pstolowski: It's not clear that tomb.Context() does what we want here [08:44] oh. maybe I'm wrong. Let's see again [08:46] jamesh: fwtw just using context.Background() makes no difference as far as close panic is concerned [08:47] @mvo: can you merge https://github.com/snapcore/snapd/pull/10849 please? failures are unrelated AFAICT [08:47] PR #10849: o/snapstate: prevent install hang if prereq install fails [08:47] miguelpires: sure! [08:49] thanks [08:51] PR snapd#10849 closed: o/snapstate: prevent install hang if prereq install fails [08:53] pstolowski: I think this is a bug in godbus [08:53] and looks to still be a bug [08:54] oh [08:54] jamesh: as I said, maybe we could just not close() as a workaround [08:55] slightly bad, but we are exiting anyway [08:55] If you call Conn.RemoveSignal(ch), then it is up to you to close the channel. If the D-Bus connection is closed, it closes all the signal channels [08:56] I'm not sure how you could write correct code with those semantics [08:58] are there current known bugs with snap-device-helper ? i see a ton of errors on a pi4 (and how would i debug this ?) [09:00] https://paste.ubuntu.com/p/Qwr6NkD3d7/ [09:00] (seems all related to the opengl interface) [09:01] (and i have to enforce SW rendering to make electron run (or use devmode)) [09:21] pstolowski: I filed https://github.com/godbus/dbus/issues/271 about the problem [09:21] pstolowski: in the short term, leaving the channel unclosed with a comment pointing at that bug report is probably the best option [09:22] jamesh: awesome, thanks for digging into it and providing good explanation in the bug report! [09:28] jamesh nice one [09:29] zyga-mbp: it'd be even nicer if I could think of a fix that wouldn't break compatibility... [09:29] * zyga-mbp jamesh I'm actually using that library as well; I'm in a bit of crunch mode before my release (6 weeks left) but I will think [09:30] zyga-mbp: the best I can think of is to have a second version of RemoveSignal that closes the connection [09:35] jamesh would it be possible to use WIthSignalHandler and provide a different logic for AddSignal and RemoveSignal? [09:35] those seem to be dispatched with an interface [09:36] and ther's a way to set the signal handler per connection instance [09:39] they abstracted a lot of things in godbus that they probably shouldn't have (e.g. serial number generation) [09:39] but replacing the default implementation with one that implements different semantics seems like a bad idea [09:45] jamesh I wonder if upstream reacts quickly or not [09:46] there seems to be little traction [09:47] zyga-mbp: they've accepted pull requests from me, and I've helped review others. I think it is more a case of lack of time. [09:47] that's good then [09:48] e.g. fixing the race conditions that used to exist in RemoveSignal [09:51] PR snapd#10857 closed: osutil/disks: add Partition struct and Disks.Partitions() [09:53] jamesh: i'm also now occasionally seeing [signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x7ad006] on github.com/snapcore/snapd/desktop/notification.(*fdoBackend).processSignal(0xc0000c2820, 0x0, 0x0, 0x0, 0x0, 0x0) now in this code (after avoiding close), still a race somewhere [09:54] but maybe it's related to the new test i'm adding in usesession/agent [09:58] pstolowski: I'm not sure. I didn't see any segfaults after removing the close() from what you'd posted earlier [09:58] did it give you any more information than that? [09:59] jamesh: no, let's not worry about that right now, i may know more when I finish my test, may as well be a problem with my test code [10:15] https://github.com/snapcore/snapd/pull/10860 needs a 2nd review [10:15] PR #10860: sandbox/cgroup: wait for start transient unit job to finish [10:16] and https://github.com/snapcore/snapd/pull/10847 too [10:16] PR #10847: cmd/snap-confine: die when snap process is outside of snap specific cgroup [10:51] PR snapd#10853 closed: tests: use the latest cpu family for nested tests execution [11:09] zyga-mbp: https://build.opensuse.org/request/show/922347 if you have a minute [11:31] PR snapd#10783 closed: [RFC, draft] tests: report stray tasks in spread test restore <⛔ Blocked> [11:42] mborzecki in a minute [11:42] mborzecki +1 [11:43] thanks! [11:43] always a pleasure :) [12:10] this if fun: `c.Check(s.Stdout(), check.Matches, fmt.Sprintf(`(?sm)Usage:\s+snap %s(?: \[[^][]+\])*(?:(?: <[^<>]+>)+(?:\.\.\.)?)?$.*`, cmd), comment)` [12:11] * zyga-mbp I see robot emojis [12:12] zyga-mbp that's what more regexes look like [12:12] miguelpires: hi! I'm just pinging you to make sure you did see my comment on https://github.com/snapcore/snapd/pull/10836 (it's fine if you prefer the current implementation, just wanted to make sure you considered the alternative :-) ) [12:12] PR #10836: many: add experimental setting to move ~/snap to ~/.snap/data [12:22] PR snapd#10864 opened: mount-control: step 3 <⛔ Blocked> [12:42] PR snapd#10865 opened: cmd/snap: improve snap run help message [12:49] mardy: sorry, I meant to reply but then completely spaced. I replied now [13:52] PR snapd#10789 closed: tests: new test invariant to check no systemd user units running [14:22] PR snapd#10789 opened: tests: new test invariant to check no systemd user units running [14:26] mvo: could you please merge https://github.com/snapcore/snapd/pull/10846 ? unrelated failures [14:26] PR #10846: desktop: implement gtk notification backend and provide minimal notification api [16:00] is this the recommended way to mock interface connections, or is there another way which allows injecting a ConnectionState object? https://github.com/snapcore/snapd/blob/master/overlord/hookstate/ctlcmd/is_connected_test.go#L201-L208 [16:06] mardy: yes that's how we do it [16:22] PR snapd#10846 closed: desktop: implement gtk notification backend and provide minimal notification api === benfrancis0 is now known as benfrancis === mup_ is now known as mup === paulw2 is now known as PaulW2U === benfrancis4 is now known as benfrancis === paulw2 is now known as PaulW2U [18:04] * cachio_ akf [18:04] afk === dbungert1 is now known as dbungert [19:08] PR snapd#10866 opened: many: replace state.State restart support with overlord/restart [19:28] PR snapd#10858 closed: osutil/disks: add Disk.FindMatchingPartitionWith{Fs,Part}Label === popey4 is now known as popey