Channels: channel_layer appears to time out

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Channels: channel_layer appears to time out

operator
Hello,

I have a project that uses Channels as a worker queue, with a SyncConsumer that runs a heavy computation task. This works great.

I transitioned the project to have a 'task in process' page that opens a websocket and through the magic of channel's groups it gets pushed the computation updates as they happen. This works great.

I'm now transitioning the project to be a single-page-app that communicates via a websocket. Using `runserver`, this works great, the websocket stays open. However, the messages from the SyncConsumer stop after a few seconds. I've established that time is whatever the value of `websocket_handshake_timeout` is, but this doesn't make sense to me AFAIK as the channel_layer is independent from the JsonWebsocketConsumer instance, and the websocket is happily connected and still passing messages.

Any ideas? Is this a bug or am I doing something wrong? 

Thanks,

Toby

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Channels: channel_layer appears to time out

Andrew Godwin-3
Hi Toby,

Do you have the latest versions of daphne, channels, asgiref and channels_redis? This sounds supiciously like a bug I fixed a couple weeks ago.

Andrew

On Thu, Mar 1, 2018 at 5:45 AM, <[hidden email]> wrote:
Hello,

I have a project that uses Channels as a worker queue, with a SyncConsumer that runs a heavy computation task. This works great.

I transitioned the project to have a 'task in process' page that opens a websocket and through the magic of channel's groups it gets pushed the computation updates as they happen. This works great.

I'm now transitioning the project to be a single-page-app that communicates via a websocket. Using `runserver`, this works great, the websocket stays open. However, the messages from the SyncConsumer stop after a few seconds. I've established that time is whatever the value of `websocket_handshake_timeout` is, but this doesn't make sense to me AFAIK as the channel_layer is independent from the JsonWebsocketConsumer instance, and the websocket is happily connected and still passing messages.

Any ideas? Is this a bug or am I doing something wrong? 

Thanks,

Toby

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFwN1upW8q-vLWMpZ7-sMoj1b61uyrPMgV7V8PS2AX0zjqSO4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Channels: channel_layer appears to time out

operator
Andrew,

Thanks for taking the time to reply. 

In classic fashion, the issue has gone away and I'm not entirely sure why. I suspect there might have been a page with older code buried somewhere, trying to do websocket things wrongly, and that was throwing things off. I'm sure it will rear it's head again, and if it does I will try and get a reproducible test case.

Toby

On Thursday, March 1, 2018 at 9:48:59 PM UTC, Andrew Godwin wrote:
Hi Toby,

Do you have the latest versions of daphne, channels, asgiref and channels_redis? This sounds supiciously like a bug I fixed a couple weeks ago.

Andrew

On Thu, Mar 1, 2018 at 5:45 AM, <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="d82PKm1_AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">oper...@...> wrote:
Hello,

I have a project that uses Channels as a worker queue, with a SyncConsumer that runs a heavy computation task. This works great.

I transitioned the project to have a 'task in process' page that opens a websocket and through the magic of channel's groups it gets pushed the computation updates as they happen. This works great.

I'm now transitioning the project to be a single-page-app that communicates via a websocket. Using `runserver`, this works great, the websocket stays open. However, the messages from the SyncConsumer stop after a few seconds. I've established that time is whatever the value of `websocket_handshake_timeout` is, but this doesn't make sense to me AFAIK as the channel_layer is independent from the JsonWebsocketConsumer instance, and the websocket is happily connected and still passing messages.

Any ideas? Is this a bug or am I doing something wrong? 

Thanks,

Toby

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="d82PKm1_AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="d82PKm1_AgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">django...@....
Visit this group at <a href="https://groups.google.com/group/django-users" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/group/django-users&#39;;return true;">https://groups.google.com/group/django-users.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/64436f7a-18d7-452b-a9cf-3580d7636b73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Channels: channel_layer appears to time out

operator
Update: there was an issue, and running the stock Ubuntu 16.04 Python was the cause; 3.5.2.

I’ve provisioned 3.6.4, and channels is doing exactly what I ask of it.

> On 2 Mar 2018, at 12:13, [hidden email] wrote:
>
> Andrew,
>
> Thanks for taking the time to reply.
>
> In classic fashion, the issue has gone away and I'm not entirely sure why. I suspect there might have been a page with older code buried somewhere, trying to do websocket things wrongly, and that was throwing things off. I'm sure it will rear it's head again, and if it does I will try and get a reproducible test case.
>
> Toby
>
> On Thursday, March 1, 2018 at 9:48:59 PM UTC, Andrew Godwin wrote:
> Hi Toby,
>
> Do you have the latest versions of daphne, channels, asgiref and channels_redis? This sounds supiciously like a bug I fixed a couple weeks ago.
>
> Andrew
>
> On Thu, Mar 1, 2018 at 5:45 AM, <[hidden email]> wrote:
> Hello,
>
> I have a project that uses Channels as a worker queue, with a SyncConsumer that runs a heavy computation task. This works great.
>
> I transitioned the project to have a 'task in process' page that opens a websocket and through the magic of channel's groups it gets pushed the computation updates as they happen. This works great.
>
> I'm now transitioning the project to be a single-page-app that communicates via a websocket. Using `runserver`, this works great, the websocket stays open. However, the messages from the SyncConsumer stop after a few seconds. I've established that time is whatever the value of `websocket_handshake_timeout` is, but this doesn't make sense to me AFAIK as the channel_layer is independent from the JsonWebsocketConsumer instance, and the websocket is happily connected and still passing messages.
>
> Any ideas? Is this a bug or am I doing something wrong?
>
> Thanks,
>
> Toby
>
> --
> You received this message because you are subscribed to the Google Groups "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a329b26e-89f5-42d1-86b2-28ad1c85bb90%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/TBWZGjwOVPA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to [hidden email].
> To post to this group, send email to [hidden email].
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/64436f7a-18d7-452b-a9cf-3580d7636b73%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/C644F7A8-D94C-4CD3-9E5D-14D1D11F663C%40tobyz.net.
For more options, visit https://groups.google.com/d/optout.