Skip to content
This repository has been archived by the owner on Nov 4, 2021. It is now read-only.

Console.log slow query warning #424

Closed
mariusandra opened this issue May 23, 2021 · 3 comments
Closed

Console.log slow query warning #424

mariusandra opened this issue May 23, 2021 · 3 comments

Comments

@mariusandra
Copy link
Collaborator

When developing locally (with postgres), I see stuff like this in the logs way too often:

⌛⌛⌛ Postgres slow query warning after 30 sec {
  queryTextOrConfig: 'INSERT INTO posthog_pluginlogentry (id, team_id, plugin_id, plugin_config_id, timestamp, source,type, message, instance_id) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)',
  values: [
    '01799986-7949-0000-cccc-a3047fc031c1',
    1,
    3,
    10,
    '2021-05-23 13:59:57.513',
    'CONSOLE',
    'LOG',
    'retrying job!',
    '01799986-30dc-0000-cf62-e49fee9f4eff'
  ]
}
[___2] 16:07:49 🤮 Unhandled Promise Error!

The unhandled promise error is from here, and the "retrying job!" message was logged from within a simple plugin:

export const jobs = {
    processEvent (event, meta) {
        console.log('retrying job!')
    }
}
export function processEvent (event, { jobs }) {
    console.log('in processEvent')
    jobs.processEvent(event).runIn(3, 'seconds')
    return event
}

I think it got worse with plugin jobs, but that might be a red herring. Possibly with just plugin logs? The console.log line in the plugins is not await-ed obviously, so perhaps that has something to do with it?

This happens often enough, but is hard to replicate reliably. Anyone have any ideas?

@mariusandra
Copy link
Collaborator Author

For more context, I started exploring this when the bigquery export plugin started giving me lines like this:

image

It was thus hard to verify if the plugin itself works or not. I hope this happens just in local development, and not in production.

@yakkomajuri
Copy link
Contributor

Documenting here that we can probably have some batching mechanism to periodically insert batches into the DB at once. I think this was mentioned elsewhere too

@neilkakkar
Copy link
Contributor

neilkakkar commented Jun 4, 2021

Possibly related to (new) issues with Bigquery plugin as well: PostHog/bigquery-plugin#9

Edit: it's not related at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants