Tuesday, 2024-10-15

opendevreviewTakashi Kajinami proposed openstack/placement master: Drop db migration tool  https://review.opendev.org/c/openstack/placement/+/93232401:40
opendevreviewBalazs Gibizer proposed openstack/nova stable/2024.2: Revert "Test live migration between hosts with differnet cpu_shared_sets"  https://review.opendev.org/c/openstack/nova/+/93237907:02
gibisean-k-mooney[m]: melwitt: I skimmed the discussion above above about the threading in scatter gather. Yes, my comment about the timer was only about the proposed native thread based code.07:17
gibialso please note in native threading there is no such thing that having a timer in an existing thread. The timer itself is always a seperate thread (with basically a sleep and a callback). So if we want a threading.timer based solution to signal an existing thread we need a communication channel between the timer thread that runs our callback on timeout and the existing thread that needs the timer 07:19
gibisignal. The most simple thing is to share an Event between the two threads. All the solution needs the existing thread to monitor some channel (e.g. the Event) periodically.07:19
sean-k-mooney[m]an event wont work as far as im aware since the event wont raise an excpetion unless we check it07:31
sean-k-mooney[m]also isint the time just a syscall to the OS to have the OS signal the thread after a timer interupt fires07:31
sean-k-mooney[m]hum, maybe a https://docs.python.org/3/library/threading.html#threading.Barrier is closer to what we want07:36
sean-k-mooney[m]the main issue is we dont really have a concpet  of a frestandign cancelable task07:36
sean-k-mooney[m]that what we really want07:36
opendevreviewMichael Still proposed openstack/nova-specs master: Repropose spice-direct console support.  https://review.opendev.org/c/openstack/nova-specs/+/93238707:45
sean-k-mooney[m]gibi: the first example here https://www.geeksforgeeks.org/python-different-ways-to-kill-a-thread/ could be adapted for our use07:46
sean-k-mooney[m]we can wrap the function into a calss with an overloaded call operator and add a function to raise the excption07:47
sean-k-mooney[m]then we can use the current timeout code to invoke that function if it expires07:47
sean-k-mooney[m]ill see if i can come up with a restandign example of that and we can see what we think of the approch07:54
gibisean-k-mooney[m]: threading.Timer is a thread not an OS signal based construct https://github.com/python/cpython/blob/546dddca43a2a69dbe33d230e9e540636b403270/Lib/threading.py#L1318-L134309:29
sean-k-mooneygibi: ya i read the docs on it after09:30
sean-k-mooneyits a subclass of thread09:30
gibisean-k-mooney[m]: python has signal handling if we want but that require special care as signal handlers can only run in the main thread and can be tricky to write them properly 09:30
sean-k-mooneyno im in two minds09:30
gibihttps://docs.python.org/3/library/signal.html#signal.SIGALRM09:31
sean-k-mooneypart of me wonders if the current approch is corect09:31
sean-k-mooneyi.e. are we trying to handle this in too generic a way09:31
sean-k-mooneythe only reason this timeout exist sis to timeout the db query to the cell db09:31
sean-k-mooneyso im partly wonderign if sqlachemy has a native way to do that09:31
gibiyeah, we can step back and look at the current use case to see if we can reformulate it09:32
sean-k-mooneyon the other hand if we dont and we want a generic killable way to execute a task a process is better for that09:32
gibiwhat we want is a to limit the API response time which a) is limited by the web server (haproxy) already I guess and b) avoid stuck threads waiting for a result that never arrives.09:33
sean-k-mooneyyep we have a few options, create a task obejct that will execute an arbitry funciton but kill itself after a timeout, run the function in a process and kill it outselves, convert it to a asyncio corutine and cancel it after a timeout or use somethign in sqlacment to kill it after a timeout at the low level09:35
gibiDo we know how many places in nova we rely on the eventlet in process timer? If it is just 2-3 places then it make sense to do a specific solution for each, if it is more than 5 then I would vote for a creation of a cancellable task primitive and use that everywhere09:39
sean-k-mooneythats a good question. This query_wrapper function is only used in one place i belive 09:40
sean-k-mooneyim not sure if we have this patterin in ohter however09:40
sean-k-mooneyim currently trying to play with creating a BoundTask class to do that09:41
sean-k-mooneymaybe TimerTask naming is hard09:41
gibiI guess we have timers in the compute for e.g. vif_plug events09:41
sean-k-mooneyyes but it depend on how they are used09:42
sean-k-mooneywhat i want to do and other can disagree09:42
sean-k-mooneyis have our main loop handel pooling for RPC messages09:42
sean-k-mooneybut dispatch the message handler to a worker thread pool09:43
sean-k-mooneyso basiclaly each RPC handlelr woudl be spawned into its own thread which it can freely block on09:43
gibiI'm not sure how oslo.messaging works in threading mode, I assumed it already does the dispatch of messages to separate threads (from a pool)09:43
sean-k-mooneyya im kind fo hoping it does but not sure either09:44
sean-k-mooneybasicaly i want use to be able to safly dispatch connurent work to a seprate io_thread_pool in our functions and block on the returned future09:45
gibihttps://docs.openstack.org/oslo.messaging/latest/reference/executors.html#threading09:45
gibiExecutor that uses a thread pool to execute calls asynchronously.09:45
sean-k-mooneyyes bvut im not sure if that is just submiting it to rabbit09:45
sean-k-mooneyi.e. the read/write calls09:46
gibiI think that is the receiving side09:46
gibithe sending side is simply blocking for cast until rabbit takes the message, and blocking for call until the response arrives09:47
sean-k-mooneyso if we get this fro free then cool, this may also be externalise in oslo.service09:47
sean-k-mooneythis was on my todo list to look at after the removel of our explict use of eventlet.tpool09:48
gibiyepp executors are for receving messages https://github.com/openstack/oslo.messaging/blob/930d97599c0048e84f7c47dca0d62d2cc0562166/doc/source/reference/executors.rst#L1209:49
sean-k-mooneyhttps://github.com/openstack/oslo.messaging/blob/930d97599c0048e84f7c47dca0d62d2cc0562166/oslo_messaging/server.py#L36809:49
sean-k-mooneyso ok _on_incomming is just submitting the callback to the executor which in threading mode is a threadpool executor form oslo messaging09:50
sean-k-mooneyso this is already done for us09:50
gibiyepp it seems so09:50
sean-k-mooneythat is what i was hoping for but as i siad i had not confirmed that till now09:50
gibibtw, as you are around, could you do a review round on the igb series https://review.opendev.org/q/topic:%22bp/igb-vif-model%22 the os-traits part is landed released an bumped into both global and nova reqs. 09:52
gibiso the nova series is ready to go09:52
sean-k-mooneyoh i was not aware we had approved the bluepirnt yet10:51
sean-k-mooneysure i stood up a devstack yesterday so i can pull it in an try it out and give it a test10:51
sean-k-mooneyill see if i can do that later today10:52
gibithanks. Yes the bp was approved couple of weeks ago10:52
sean-k-mooneyack i vagule remember that but it didnt click that it was ready for review again10:52
sean-k-mooneyfor some reasoin i tought we were waiting for the ptg but i was proably thinking about somethign else10:53
WJeffs1Hey, So I was sure I saw an option once, to run a script locally on the HV after a VM is created and the same for deletion? As I'm being overly hopeful or is this actually an option?11:14
sean-k-mooneynot in nova but it is in libvirt11:14
sean-k-mooneylibvirt has hooks11:14
sean-k-mooneywe dont supprot that but it would allow you to do that11:14
WJeffs1ahh that was probably where I saw it :) I'll dig there thanks!11:14
opendevreviewStephen Finucane proposed openstack/placement master: requirements: Remove setuptools  https://review.opendev.org/c/openstack/placement/+/93239811:50
opendevreviewStephen Finucane proposed openstack/placement master: Add pyproject.toml to support pip 23.1  https://review.opendev.org/c/openstack/placement/+/93239911:50
opendevreviewTakashi Kajinami proposed openstack/nova master: Remove Windows OS Support  https://review.opendev.org/c/openstack/nova/+/93240712:56
opendevreviewTakashi Kajinami proposed openstack/nova master: Drop dependency on netifaces  https://review.opendev.org/c/openstack/nova/+/93158213:10
opendevreviewTakashi Kajinami proposed openstack/nova master: Remove Windows OS Support  https://review.opendev.org/c/openstack/nova/+/93240713:11
opendevreviewTakashi Kajinami proposed openstack/nova master: Drop dependency on netifaces  https://review.opendev.org/c/openstack/nova/+/93158213:11

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