Skip to content

Websocket fails with cro-websocket >0.8.7 on ping #41

@maros

Description

@maros
Mar 06 12:27:21 statusapps werdad[3889262]: Mattermost WebSocket is gone. Reconnecting
Mar 06 12:27:22 statusapps werdad[3889262]: Invocant of method 'unlock' must be an object instance of type 'Lock',
                                            not a type object of type 'Lock'. Did you forget a '.new'?
                                              in block  at /opt/rakudo-pkg/share/perl6/site/sources/45334C557865A97D1ECA0D3F3A3FAF2017FCE553 line 30
                                              in block  at /opt/rakudo-pkg/share/perl6/site/sources/45334C557865A97D1ECA0D3F3A3FAF2017FCE553 line 25
                                              in method ping at /opt/rakudo-pkg/share/perl6/site/sources/43B45024F925BC97E4E6FB16AA646E0F82BFA422 line 174
                                              in block  at /opt/gh/geizhals-werda/service.p6 line 67

45334C557865A97D1ECA0D3F3A3FAF2017FCE553 is MetamodelX::MonitorHOW
43B45024F925BC97E4E6FB16AA646E0F82BFA422 is X::Cro::WebSocket::Client::Closed

Caller code is

    # Start main websocket loop
    start react {
        whenever Supply.interval(60,10) {
            if ($connection && ! $connection.closed) {
                await $connection.ping(timeout => 1); # this line causes the exception

                CATCH {
                    default {
                        $log.error('Mattermost WebSocket is gone. Reconnecting');
                        $log.warn(.gist);
                        connect();
                    }
                }
            } else {
                connect();
            }
        }
    }

Downgrade to 0.8.6 mitgates the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions