@@ -1328,32 +1328,6 @@ int mcplib_rcontext_wait_handle(lua_State *L) {
1328
1328
return lua_yield (L , 1 );
1329
1329
}
1330
1330
1331
- // TODO: This is disabled due to issues with the IO subsystem. Fixing this
1332
- // requires retiring of API1 to allow refactoring or some extra roundtrip
1333
- // work.
1334
- // - if rctx:sleep() is called, the coroutine is suspended.
1335
- // - once resumed after the timeout, we may later suspend again and make
1336
- // backend requests
1337
- // - once the coroutine is completed, we need to check if the owning client
1338
- // conn is ready to be resumed
1339
- // - BUG: we can only get into the "conn is in IO queue wait" state if a
1340
- // sub-IO was created and submitted somewhere.
1341
- // - This means either rctx:sleep() needs to be implemented by submitting a
1342
- // dummy IO req (as other code does)
1343
- // - OR we need to refactor the IO system so the dummies aren't required
1344
- // anymore.
1345
- //
1346
- // If a dummy is used, we would have to implement this as:
1347
- // - immediately submit a dummy IO if sleep is called.
1348
- // - this allows the IO system to move the connection into the right state
1349
- // - will immediately circle back then set an alarm for the sleep timeout
1350
- // - once the sleep resumes, run code as normal. resumption should work
1351
- // properly since we've entered the correct state originally.
1352
- //
1353
- // This adds a lot of CPU overhead to sleep, which should be fine given the
1354
- // nature of the function, but also adds a lot of code and increases the
1355
- // chances of bugs. So I'm leaving it out until this can be implemented more
1356
- // simply.
1357
1331
int mcplib_rcontext_sleep (lua_State * L ) {
1358
1332
mcp_rcontext_t * rctx = lua_touserdata (L , 1 );
1359
1333
if (rctx -> wait_mode != QWAIT_IDLE ) {
0 commit comments