Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affiliates pico gets stuck, with a query that starts but never ends #28

Open
b1conrad opened this issue Jan 5, 2025 · 3 comments
Open
Assignees

Comments

@b1conrad
Copy link
Member

b1conrad commented Jan 5, 2025

I believe this query comes from the developer UI. Here is the transaction:

{"level":50,"time":"2025-01-03T20:02:42.578Z","picoId":"cljt4uezc0006qipr9r824thx","txnId":"cm5h6m9010dco9vprdz45ezk8","txn":{"id":"cm5h6m9010dco9vprdz45ezk8","kind":"query","query":{"eci":"cljt4uezj000aqiprdhpn55yu","rid":"io.picolabs.pico-engine-ui","name":"box","args":{"_headers":{"host":"localhost:3000","connection":"close","sec-ch-ua-platform":"\"macOS\"","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","sec-ch-ua":"\"Google Chrome\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"","sec-ch-ua-mobile":"?0","accept":"*/*","sec-fetch-site":"same-origin","sec-fetch-mode":"cors","sec-fetch-dest":"empty","referer":"https://plan.picolabs.io/dev-io.html","accept-encoding":"gzip, deflate, br, zstd","accept-language":"en-US,en;q=0.9,ko;q=0.8,fr;q=0.7,ig;q=0.6","cookie":"cljt4um3u000tqiprcp8cecqy=clkaafavx04ex6bpr6vabebv4; cljt4uezc0006qipr9r824thx=clkmk6dxr065z6bpr70eid8kl; clky5q86807x46bpra1qi8xaq=clky73kwb08476bpra6a2bsw4; clkytli0108ag6bpr771c95vn=cllq0u0ua05ie9vpr63pvdvew; clm27gu1w03iwzhprbgh4ajm0=clm27gyt303jlzhprdks26nh6; cln29zwga0bj7zhpr2sy6h55e=cln2a02440bjwzhpr10c47in6; cln2a2it40bnlzhpr4trs4x5h=cln2a2lza0boazhpr8d9o6sjl; clo7nh7e3040m75pr7nze2hsn=clozrqzfi08vhvvprg4p9a0w9","if-none-match":"W/\"2c1-kRpgs/NKli5q2zmeB9SdvgcT9cw\""}}}},"msg":"txnQueued"}
{"level":50,"time":"2025-01-03T20:02:42.578Z","picoId":"cljt4uezc0006qipr9r824thx","txnId":"cm5h6m9010dco9vprdz45ezk8","msg":"txnStart"}

It is the engine ui channel that is used to send the message. It must be a loop of some kind.

@b1conrad b1conrad self-assigned this Jan 5, 2025
@b1conrad
Copy link
Member Author

b1conrad commented Jan 5, 2025

Found this by using the id of the Affiliates pico and scanning the forever log file, as follows:

$ grep cljt4uezc0006qipr9r824thx MNdW.log | grep txnStart | wc
     502     502   68774
$ grep cljt4uezc0006qipr9r824thx MNdW.log | grep txnDone | wc
     501     501   68136
$ grep cljt4uezc0006qipr9r824thx MNdW.log | grep txnStart | tail -1
{"level":50,"time":"2025-01-03T20:02:42.578Z","picoId":"cljt4uezc0006qipr9r824thx","txnId":"cm5h6m9010dco9vprdz45ezk8","msg":"txnStart"}

Note that there is an extra start, and the transaction id is obtained from the last start.

@b1conrad
Copy link
Member Author

b1conrad commented Jan 5, 2025

Obtained the pico's id by invoking the myself function of the io.picolabs.wrangler ruleset. This was done in the Testing tab of the developer UI.

@b1conrad
Copy link
Member Author

Yes, there is a problem in the io.picolabs.pico-engine-ui implementation of box, which uses ctx:query to get the parent ECI. This means that a parent pico CANNOT use picoQuery to get the box of any of its child picos. The penalty is that the parent pico will be "stuck" in that it will no longer be able to handle any events or queries.

Modified the ruleset on the PLAN server to add a function just_box that avoids this. But the developer UI will need to be changed to not use box in that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant