qewd icon indicating copy to clipboard operation
qewd copied to clipboard

bug with resilient mode and gtm

Open killmenot opened this issue 6 years ago • 4 comments

Hey @robtweed

Simple test should be able to send message using websockets:

describe('custom message', () => {
    let data;

    beforeEach((done) => {
      request.
        post('/ajax').
        send({
          type: 'ewd-register',
          application: 'test-app'
        }).
        end((err, res) => {
          if (err) return done.fail(err);

          data = {
            type: 'test',
            token: res.body.token,
            params: {
              text: 'Hello world'
            }
          };

          done();
        });
    });

    it('should be able to send message using websockets', (done) => {
      const socket = io.connect('ws://localhost:8080');

      socket.on('connect', () => socket.emit('ewdjs', data));
      socket.on('ewdjs', (responseObj) => {
        socket.disconnect();

        expect(responseObj).toEqual({
          type: 'test',
          finished: true,
          message: {
            text: 'You sent: Hello world via express'
          },
          responseTime: jasmine.stringMatching(/^\d*ms$/)
        });

        done();
      });
    });
  });

QEWD configuration:

  • express
  • gtm
  • resilientMode

Output: screenshot 2017-11-28 02 44 44

QEWD configuration:

  • express
  • redis
  • resilientMode screenshot 2017-11-28 02 45 14

killmenot avatar Nov 27 '17 23:11 killmenot

To be honest have no idea why...

killmenot avatar Nov 27 '17 23:11 killmenot

Rob:

currently GT.M /Yotta can't be used in resilient mode, because The asynchronous API versions needed by the master process aren't yet available in NodeM. David Wicksell (the author of NodeM) is supposed to be working on them. My guess would be that this is why things go wrong in that mode

killmenot avatar Nov 28 '17 09:11 killmenot

@robtweed Maybe we need to see if database is gtm and resilient mode is ON to throw some error during start QEWD in master.js?

killmenot avatar Nov 28 '17 10:11 killmenot

I just came across this issue, and wanted to mention that this should now be fixed. I implemented the asynchronous versions of all APIs needed for resilient mode to work in QEWD, as of NodeM version 0.12.0. The current version of NodeM is 0.12.1, and has optimized performance when using YottaDB r1.20 or newer, as well as the aforementioned asynchronous APIs, needed to work with QEWD's resilient mode.

So, unless I'm missing something, this issue should be able to be closed, and marked as resolved.

dlwicksell avatar Oct 11 '18 20:10 dlwicksell