Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
It’s been a while.
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ruuuui
September 14, 2017
0
26
It’s been a while.
ruuuui
September 14, 2017
Tweet
Share
More Decks by ruuuui
See All by ruuuui
TCP/IP
ruuuui
0
60
log
ruuuui
0
59
Malware
ruuuui
0
41
File
ruuuui
0
50
リダイレクト
ruuuui
0
38
a
ruuuui
0
50
Featured
See All Featured
Navigating Weather and Climate Data
rabernat
0
100
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
52
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Discover your Explorer Soul
emna__ayadi
2
1.1k
Tell your own story through comics
letsgokoyo
1
800
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
61
52k
The agentic SEO stack - context over prompts
schlessera
0
630
Building an army of robots
kneath
306
46k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
0
100
Transcript
ڞ༗ࢿݯʹؔ͢Δ ށݐɹߥҪ ྨ
ϨʔείϯσΟγϣϯ
Race Condition(ڝ߹ঢ়ଶ)ͷ੬ऑੑ ✦ ֓ཁ • ڞ༗ࢿݯͱ ෳͷϓϩηοα͔Βʰಉ࣌ʱʹར༻͍ͯ͠Δ มɾڞ༗ϝϞϦɾDBɾϑΝΠϧͷ͜ͱ ڞ༗ࢿݯʹର͢Δഉଞ੍ޚ͕ෆेͳ߹ ڝ߹ঢ়ଶͷݪҼͱͳΔ
Race Conditionͷදྫ • ผਓͷݸਓใͳͲ͕දࣔ͞ΕΔ • DBͷෆ߹ • ϑΝΠϧ༰ͷഁյ
Πϯελϯεมͱ • ΦϒδΣΫτͷதͰΛอଘ͓ͯͨ͘͠Ίͷར༻͞ΕΔͷ͕ ʮΠϯελϯεมʯͰ͢ɻ • ΠϯελϯεมΫϥεͰશϝιουͰڞ௨ͯ͠༻͢Δ͜ͱ ͕ग़དྷ·͢ɻ • ࠷ॳʹͲ͔͜ͷϝιουͰ༻͞Εͨ࣌ͰΠϯελϯεม࡞ ͞ΕɺҰ࡞͞ΕͨΠϯελϯεมଞͷϝιουͰΛऔ
Γग़ͨ͠Γ֨ೲͨ͠Γ͢Δ͜ͱ͕ग़དྷΔΑ͏ʹͳΓ·͢ɻ
߈ܸख๏ͱӨڹ ӈͷϓϩάϥϜnameจࣈྻΛड͚औͬͯ Πϯελϯεมnameʹೖ͠ɺ̏ඵ·͔ͬͯΒɺ ΠϯελϯεมΛදࣔ͢ΔϓϩάϥϜ
߈ܸख๏ͱӨڹ
• มnameڞ༗ม • ڞ༗มnameͷഉଞ੍ޚΛ͍ͯ͠ͳ͍ ੬ऑੑ͕ੜ·ΕΔݪҼ αʔϒϨοτΫϥεͷΠϯελϯεม͕ ڞ༗ࢿݯͰ͋Δ͜ͱΛΒͳ͍ͱɺىͯ͜͠͠·͏
• ՄೳͰ͋Εڞ༗ࢿݯΛ༻͠ͳ͍ ex. String name = req.getParameter(“name”); • ڞ༗ࢿݯʹରͯ͠ഉଞ੍ޚΛߦ͏ synchronizedจsynchronisedϝιουΛར༻
ରࡦ
yamadaॲཧ tanakaॲཧ 1sec name=“yamada”; ༷ʑͳॲཧ(̏ඵ) nameදࣔ(yamada) SynchronisedʹΑΓػ (̎ඵ) name=“tanaka”; ༷ʑͳॲཧ(̏ඵ)
nameදࣔ(tanaka) 0sec 2sec 3sec 4sec 5sec 6sec
·ͱΊ • ڞ༗ࢿݯͰ͖Δ͚ͩΘͳ͍ • ഉଞॲཧΛ͗ͯ͢͠DoS੬ऑੑΛ࢈ΜͰ͠·͏ͷͰɺ ฒߦॲཧɾϚϧνεϨουϓϩάϥϛϯάΛߦ͏