On Feb 10, 2016, at 3:16 AM, Miha Zoubek wrote:

> i am trying to use multi process for one thing. I fallowed this tutorial: 
> https://codeforgeek.com/2014/12/cluster-node-js-performance/
> 
> After i stard nodejs app, after 4 min i get:
> 
> /var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/Parser.js:77
>         throw err; // Rethrow non-MySQL errors
>               ^
> Error: ER_DUP_ENTRY: Duplicate entry '381611335152' for key 'PRIMARY'
>     at Query.Sequence._packetToError (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/sequences/Sequence.js:48:14)
>     at Query.ErrorPacket (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/sequences/Query.js:83:18)
>     at Protocol._parsePacket (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/Protocol.js:280:23)
>     at Parser.write (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/Parser.js:73:12)
>     at Protocol.write (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/Protocol.js:39:16)
>     at Socket.<anonymous> (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/Connection.js:96:28)
>     at Socket.emit (events.js:95:17)
>     at Socket.<anonymous> (_stream_readable.js:765:14)
>     at Socket.emit (events.js:92:17)
>     at emitReadable_ (_stream_readable.js:427:10)
>     --------------------
>     at Protocol._enqueue (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/protocol/Protocol.js:141:48)
>     at Connection.query (/var/www/html/LDB-
> rs/nodejs/node_modules/mysql/lib/Connection.js:201:25)
>     at /var/www/html/LDB-rs/nodejs/app.js:41:16
>     at Function._.each._.forEach (/var/www/html/LDB-
> rs/nodejs/node_modules/underscore/underscore.js:153:9)
>     at /var/www/html/LDB-rs/nodejs/app.js:39:6
>     at Parser.<anonymous> (/var/www/html/LDB-
> rs/nodejs/node_modules/xml2js/lib/xml2js.js:484:18)
>     at Parser.emit (events.js:95:17)
>     at Object.onclosetag (/var/www/html/LDB-
> rs/nodejs/node_modules/xml2js/lib/xml2js.js:445:26)
>     at emit (/var/www/html/LDB-
> rs/nodejs/node_modules/xml2js/node_modules/sax/lib/sax.js:639:35)
>     at emitNode (/var/www/html/LDB-
> rs/nodejs/node_modules/xml2js/node_modules/sax/lib/sax.js:644:5)
>     at closeTag (/var/www/html/LDB-
> rs/nodejs/node_modules/xml2js/node_modules/sax/lib/sax.js:903:7)
> worker 8423 died
> 
> 
> I guess this is due to multi core thing, if i use only one core it works ok.
> Progrem read one xml file, put it in json and then insert in the mysql table.

Looks like you're trying to insert the same primary key into the database more 
than once. Don't do that.



-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/C041812D-6390-42C2-BCF9-F5C276A62F97%40ryandesign.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to