-
Notifications
You must be signed in to change notification settings - Fork 331
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
🐛 Bug Report — Logging broken in hibernatable WebSocket event handlers #2089
Comments
I observe identical behavior |
@MellowYarker @jasnell @kentonv Sorry to ping you this way but could someone please triage this? It's not a blocker for us since we have the work-around, and I can't look at it again for a few weeks anyways, but now that someone else ran into it maybe it's worth taking a look? |
Huh, not sure of anything that would have caused this to break. Was it always broken or did you notice a regression? Will take a look next week. |
We only started using hibernatable sockets a few months ago, so I can't tell if it was broken from the beginning. |
Haven't forgotten about this, just been a bit hectic this week! Still on my todo list. |
@codefrau sorry for the delay. I just tested this and I seems to work for me. My steps were:
Is there any way you could help narrow the behavior down? |
Hi @MellowYarker - thank you for getting back to this. I'm keeping the engines running here while @codefrau is out of the office. Using your basic example, I initially saw the same response as you. After a while I went back to our application and re-deployed to test out one theory - which proved unhelpful... but it did reveal that the basic logging was initially working, but stopped working after a few minutes. To test this, I added
to the
Below is a screenshot of the |
@aranlunzer thanks for looking into this some more! I ran the same experiment as you and saw logs from Which browser are you using? Also, would you mind adding a log to the |
@MellowYarker After some further hours of experiments, my main finding is that the results are wildly inconsistent, with no readily discernable pattern. To maximise your chances of reproduction, here is what I am using. wrangler.toml
index.ts (note removal of
index.html
This evening I have re-deployed around 50 times. Sequence:
Once the change is observed (or after around 5 minutes it it's still going)
The time taken for logging from the websocket request to start failing is extremely variable. Sometimes after just 20s; most often somewhere in the range 100-200s; occasionally it's still going even after 300s (so I reset and try again). [edit] Forgot to mention: I'm using Chrome to load the web page, and make sure to keep the tab visible so the timers continue to work. |
We have one DurableObject that uses the hibernation API. It implements
webSocketMessage()
in which we useconsole.log()
to log stuff.On miniflare (
wrangler dev
) that works perfectly fine, the logs appear in the terminal, as they should.When deployed to Cloudflare though, nothing is logged from within the
webSocketMessage()
handler. The handler method with the log statement is executed and works fine.This happens both with
wrangler tail
, as well as our log push job to an R2 bucket. All other log calls work fine.I added a workaround where for that DO we additionally send every log message to another DO and log it there. That works.
The text was updated successfully, but these errors were encountered: