Tuesday, 2026-02-10

dviroelit looks like our grenade job is broken with the issue: "ModuleNotFoundError: No module named 'pkg_resources'"11:56
dviroelI think that we need to wait for the pin setuptools fixes 12:03
opendevreviewTakashi Kajinami proposed openstack/watcher master: devstack: Remove ineffective ssl options  https://review.opendev.org/c/openstack/watcher/+/97580912:08
opendevreviewJoan Gilabert proposed openstack/watcher master: Use wrapper classes for novaclient objects  https://review.opendev.org/c/openstack/watcher/+/97291313:02
opendevreviewJoan Gilabert proposed openstack/watcher master: Change id field to uuid when appropiate  https://review.opendev.org/c/openstack/watcher/+/97520013:02
opendevreviewJoan Gilabert proposed openstack/watcher master: Prepare to use openstacksdk instead of novaclient  https://review.opendev.org/c/openstack/watcher/+/97471013:02
opendevreviewJoan Gilabert proposed openstack/watcher master: Complete migration from novaclient to openstacksdk  https://review.opendev.org/c/openstack/watcher/+/97492413:02
opendevreviewJoan Gilabert proposed openstack/watcher master: Remove usage of novaclient from Watcher  https://review.opendev.org/c/openstack/watcher/+/97492513:02
opendevreviewJoan Gilabert proposed openstack/watcher master: Remove nova_helper retries for openstacksdk params  https://review.opendev.org/c/openstack/watcher/+/97549813:02
sean-k-mooneydviroel: yes i think gmann is lookign into grenade fixes but the setuptools pin is not trivial14:22
sean-k-mooneywe actully need to disable build isolation which is not good14:22
sean-k-mooneyso this is obviosly evolving14:23
sean-k-mooneyfixing grenade alse require use to emrge patchies in teh reverse order in some cases so its a mess14:23
dviroelyeah, I'm also following the discussion in the ML 14:24
opendevreviewJoan Gilabert proposed openstack/watcher master: Use wrapper classes for novaclient objects  https://review.opendev.org/c/openstack/watcher/+/97291315:19
opendevreviewJoan Gilabert proposed openstack/watcher master: Change id field to uuid when appropiate  https://review.opendev.org/c/openstack/watcher/+/97520015:19
opendevreviewJoan Gilabert proposed openstack/watcher master: Prepare to use openstacksdk instead of novaclient  https://review.opendev.org/c/openstack/watcher/+/97471015:19
opendevreviewJoan Gilabert proposed openstack/watcher master: Complete migration from novaclient to openstacksdk  https://review.opendev.org/c/openstack/watcher/+/97492415:19
opendevreviewJoan Gilabert proposed openstack/watcher master: Remove usage of novaclient from Watcher  https://review.opendev.org/c/openstack/watcher/+/97492515:19
opendevreviewJoan Gilabert proposed openstack/watcher master: Remove nova_helper retries for openstacksdk params  https://review.opendev.org/c/openstack/watcher/+/97549815:19
dviroelsean-k-mooney: amoralej_ jgilaber: WRT SQLite errors when running with parallel engine and native threads, i have some other tests results:15:19
dviroelI can reproduce the same issue replacing Taskflow by a ThreadPool, that runs actions in parallel15:19
sean-k-mooneyack we expect each thread to use its own sperate connection15:20
dviroelIt is also possiblle to create a new unit test in Nova to simulate the same behavior (concurrent threads updating Server states), and it also fail in the same way...15:20
sean-k-mooneywell you are ment to use a lock on the instnace uuid to prevent that15:20
sean-k-mooneythat actully might be the fix 15:20
sean-k-mooneywe can use the oslo concurance lockutils.synconise decorator to add a lock on the action state update using the action uuid15:21
amoralej_if the problem is in sqlite managing concurrency that should work15:21
sean-k-mooneyso any one action shoudl only be mutated form one trhead at a time15:21
sean-k-mooneyif we are modifyign it form diffent thread we need to ahve a lock to serialsie the critical sections15:22
amoralej_but the processes which are interlocking are on the same action ?15:22
sean-k-mooneyand we need that lock even with eventlet15:22
sean-k-mooneyits a pre exisitng bug15:22
amoralej_what are actually the locking queries ?15:22
dviroelno, each thread updates a different action15:22
amoralej_that was my understanding15:22
amoralej_for what i understood from dviroel, it's not a bug15:23
amoralej_it's a limitation in sqlite15:23
dviroelyes, that's my point, it doesn't deal with concurrent writes15:24
amoralej_(btw, i've been testing the sqlalchemy traces with osprofile and it will work, i'll send the patch soon if you want to use it)15:24
amoralej_and that's why we never hit that out of unit tests, i guess15:25
amoralej_is there any way to improve concurrency behavior in sqlite? what we mentioned of using file-backed db?15:26
sean-k-mooneyi guess sqlight m8ight be lockign the file/table15:26
sean-k-mooneyrather then at the rwo level but i tought hat was also doable15:26
amoralej_so, i wouldn't do exotic things in sqlite or db connection side to fix an issue which is ci only15:31
sean-k-mooneyamoralej_ its not clear it is ci only15:32
amoralej_everything i hear looks like so :)15:32
sean-k-mooneyif its diffent action it may be15:32
amoralej_is it possible to use the mysql fixtures for this test ?15:32
dviroelthe unit test that claude assisted to create: https://paste.centos.org/view/c5679727 (for Nova)15:32
amoralej_at least to check if we can reproduce it with mysql15:32
sean-k-mooneyyes but i dont really want to do that15:32
amoralej_https://news.ycombinator.com/item?id=45508462 "The single-writer limitation in SQLite is per-database, not per-connection."15:33
amoralej_it's not a manual ^ but ...15:33
sean-k-mooneyamoralej_: so sqlachme is ment to handelign that for us15:34
amoralej_how15:34
sean-k-mooneyits ment to make sure that only one transaction is executing at a time15:34
amoralej_even for different threads? 15:35
sean-k-mooneyi belive so yes 15:35
sean-k-mooneydviroel: canyou set https://github.com/openstack/watcher/blob/master/watcher/tests/fixtures/conf_fixture.py#L30 to ture15:35
amoralej_if sqlalchemy can do the trick for us, that'd be good15:37
sean-k-mooneywe are setting it to false for perforamce reasons i think in test but we might need to rethink that when using real treads15:38
dviroelyes, I already did that, but i can just rerun with true again here15:39
dviroelyeah, still fails with synchronous to True15:41
sean-k-mooneyack15:41
dviroeli've also trie enabled WAL too: https://www.sqlite.org/wal.html15:41
sean-k-mooneyso filebacked and synconus and with wal and it still happens with all 315:41
amoralej_https://oldmoe.blog/2024/07/08/the-write-stuff-concurrent-write-transactions-in-sqlite/ according to that, wal only helps in multiple reads15:42
amoralej_not writes15:42
dviroelyeah15:42
dviroelit allow concurrent reads and one write, but does not solve multiple writes15:43
sean-k-mooneyso all db writes in watcher should be happening under a writer tranaction15:43
sean-k-mooneyin the test we coudl monkey patch that to add a lock15:43
sean-k-mooneythat will serialise all writes15:43
amoralej_but we don't want that for production, right?15:44
dviroeli think that would be just for unit test?15:45
sean-k-mooneythat why i said monky patch or baiclly use a fixture 15:45
sean-k-mooneyso in the base testcase we can wrap the normal write traskaction in a lock15:45
amoralej_but, why we need to force to use sqlite even if that means hacking code in tests?15:46
sean-k-mooneybecasue we have a requiremetn that all unit test must run with sqlite15:46
sean-k-mooneyso we make it work or we remvoe teh test15:46
amoralej_then, let's change the unit tests15:46
dviroelhumm15:46
amoralej_but for me, that means we will never be able to test concurrency in unit tests15:47
sean-k-mooneywell we shoudl not by defintion15:47
amoralej_which ok, maybe that's something only for funtional or tempest tests15:47
sean-k-mooneyits ok to do that in a fucntional test but not really in unit tests15:48
amoralej_ok, then let's rework the test and mock the writes or whatever we need15:48
sean-k-mooneythat a way forward but we will ahve to solve this for the funcitoal tests where we will want to test with mutliple threads15:49
amoralej_and another database :)15:50
sean-k-mooneyno15:50
sean-k-mooneythe funcitonal test sshoudl work with sqlite too15:50
amoralej_then, it's not functional15:50
amoralej_why15:50
sean-k-mooneyit is15:50
sean-k-mooneyfuncitonal test are not allowed to dependn on external processes15:50
sean-k-mooneythey do not mock the internal code but mock the extenral service they interact with 15:51
sean-k-mooneyor use a replacement like sqlight15:51
sean-k-mooneythey are inteded to be run localy before pushing to ci15:51
sean-k-mooneyand we shoudl not need to install a db on your laptop to run them15:51
sean-k-mooneyrequiring mysql to run the funcional tests basiclly means your going to have to do yoru dev in a vm most of the time because you should be runnign unit and funcitonal tests locally beofre pushing a patch for review15:52
sean-k-mooneyim not saying we canat decisde to use something other then sqlite im sayign if we do that it a very big change in the develope workflow and not one we shoudl do lightly15:53
amoralej_but in functional tests we'll need to run watcher-api, watcher-applier and watcher-decision-engine in parallel15:54
amoralej_right?15:54
sean-k-mooneyyep15:54
amoralej_and sqlite will be able to handle concurrency between different processes?15:54
amoralej_i'd say not15:54
sean-k-mooneywhich we do for nova-compute, nova-api nova-schduler and nova-conductor to name but a few today 15:54
sean-k-mooneywith sqlite at least under eventlet15:54
amoralej_how you do it in nova?15:55
sean-k-mooneywe havent done it in threaded mode but ineventlety each runs in its own eventlet15:55
sean-k-mooneyand only one is ever writign to the db at once as a result as there is only 1 thread15:55
sean-k-mooneyi want to emulate that in the threaded world too if we can15:55
sean-k-mooneywe use oslo messaging in memroy transport to simulate rabbit15:56
sean-k-mooneyand sqlite fo rthe db15:56
amoralej_so you run a single process running nova-compute, nova-schedule, etc.. in different threads?15:56
sean-k-mooneyin diffent greentread via eventlet yes15:56
amoralej_same process but different eventlets, i mean15:56
sean-k-mooneyyep15:56
amoralej_that's much more invasive that i thought, tbh15:56
sean-k-mooneynot really15:57
amoralej_i was thinking in running them as independent processes similar to a real deployment15:57
sean-k-mooneythat woudl not be a fucntionla test that woudl be an integration test at that point15:57
amoralej_well, functional tests are kind of integration tests, imo15:59
sean-k-mooneythey are not15:59
sean-k-mooneythey are very much a sepreate clase between unit and integration tests15:59
sean-k-mooneyas they are not ment to tst the integration with external services15:59
sean-k-mooneyjust the internal funcitoning fo the service under test15:59
amoralej_but that does not imply that we are force to run everything in the same process16:00
sean-k-mooneyso they mock or fake the external deps btu do not mock the internal service16:00
sean-k-mooneywe are not force too but i strongly belive we should16:00
sean-k-mooneyneutron and glance both tried to so testing clsoe to what you descibed and that proved very hard to maintain and debug16:02
amoralej_well, if we force to use sqlite, there is no other way (assuming we can make sqlite_synchronous work)16:02
dviroeli got the idea, and the requirement that anyone could run both unit and funcional tests without installing/configuring additional services16:02
sean-k-mooneyis https://review.opendev.org/c/openstack/watcher/+/975522 the patch your working on?16:03
dviroelI can continue in this one, but was just to show the current issue yeah16:04
sean-k-mooneyi am asking because i want to play with it locally16:04
sean-k-mooneyi.e. to test an idea16:04
dviroelah ok, yes you can get this patch16:05
sean-k-mooneyso i want too repoduce it first which ithink just needs  engine_type = "parallel"16:05
dviroeland use the file based configuration too16:06
dviroelin memory is more limited than the file16:06
*** dviroel is now known as dviroel_lunch16:11
*** dviroel_lunch is now known as dviroel16:58
opendevreviewAlfredo Moralejo proposed openstack/watcher master: Add OSProfiler support for cross-service tracing  https://review.opendev.org/c/openstack/watcher/+/97628017:28
dviroel\o/17:57
opendevreviewsean mooney proposed openstack/watcher master: Enable parallel TaskFlow engine in threading mode  https://review.opendev.org/c/openstack/watcher/+/97629319:37
sean-k-mooneydviroel: ^ seams to work19:38
sean-k-mooneywe were actully missing decorators https://review.opendev.org/c/openstack/watcher/+/976293/1/watcher/db/sqlalchemy/api.py19:38
sean-k-mooneybut that by itslef was not enough to fix it19:39

Generated by irclog2html.py 4.0.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!