fluree / db

Fluree database library
https://fluree.github.io/db/
Other
338 stars 22 forks source link

Unicode Chars in @id field of TX's cause server hang!! #918

Open alan-icebreaker opened 6 hours ago

alan-icebreaker commented 6 hours ago

Full Discord Thread: https://discord.com/channels/896089675511508992/896089675511508995/1299186180210036747

Note - I originally thought this was related to GC, or the Refreshing Index stage, but that was a red herring.

TL;DR

A transaction inserting an @id which contains a unicode character (confirmed with ஃ, •) causes fluree to hang, sometimes indefinitely, but usually for many minutes, preventing any further TX's from processing.

I've sometimes had to just restart the server to restore it to normal state.

Here's the smallest TX I've been able to craft which triggers the issue...

{
  "@context": {
    "user": "https://lod.icebreaker.xyz/schemas/user/1.0/"
  },
  "ledger": "icebreaker/core",
  "insert": [
    {
      "@id": "user:ஃ", 
      "@type": "user:Foo"     
    }
  ]
}
alan-icebreaker commented 5 hours ago

A few additional points...

  1. While the server is processing this bad TX, all subsequent TX's will timeout (as noted above)
  2. I've seen hangs of a few minutes to almost indefinite hanging (IIRC).
  3. The logs in the server don't indicate anything wrong with this bad TX, so its difficult to know anything's hung
  4. w.r.t. unicode in @id's - I know unicode is legal inside IRI's, but not URL's - So I guess the question is what does fluree support for @id's - URL's or IRI's?